/* Panel usuario tienda — inspirado en CRM admin */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --cu-body: #f1f5f9;
  --cu-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 55%, #0f2744 100%);
  --cu-primary: #3a647e;
  --cu-accent: #0ea5e9;
  --cu-text: #334155;
  --cu-muted: #64748b;
  --cu-card: #ffffff;
  --cu-line: #e2e8f0;
  --cu-side-w: 250px;
  --cu-side-w-close: 78px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
}
html {
  height: 100%;
}
body.cu-app {
  min-height: 100vh;
  font-family: Poppins, sans-serif;
  font-size: 15px;
  color: var(--cu-text);
  background: var(--cu-body);
}
body.cu-login {
  min-height: 100vh;
  font-family: Poppins, sans-serif;
  font-size: 15px;
  color: var(--cu-text);
  background: #0f172a;
  overflow-x: hidden;
}

/* —— Login —— */
.cu-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, rgba(14,165,233,.25), transparent 55%),
    linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0f2744 100%);
}
.cu-login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 24px;
  box-shadow: 0 20px 50px rgba(2,6,23,.35);
}
.cu-login-card .brand { text-align: center; margin-bottom: 20px; }
.cu-login-card .brand img { max-height: 56px; max-width: 180px; margin-bottom: 10px; }
.cu-login-card .brand h1 { margin: 0; font-size: 1.5rem; color: #0f172a; }
.cu-login-card .brand p { margin: 6px 0 0; color: var(--cu-muted); font-size: .95rem; }
.cu-login-card label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #475569;
  margin: 12px 0 5px;
}
.cu-login-card input {
  width: 100%;
  border: 1px solid var(--cu-line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
}
.cu-login-card input:focus {
  outline: none;
  border-color: var(--cu-accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,.2);
}
.cu-login-card .btn-login {
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 10px;
  padding: 13px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}
.cu-login-card .foot {
  margin-top: 14px;
  text-align: center;
  font-size: .95rem;
  color: var(--cu-muted);
}
.cu-login-card .foot a strong { font-weight: 800; color: #0f766e; }
.cu-auth-hint {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
}
.cu-wa-help {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 0.84rem;
  line-height: 1.4;
}
.cu-login-card label {
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
}
.cu-alert-err {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.cu-alert-ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

/* —— Sidebar —— */
.cu-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--cu-side-w);
  padding: 10px 12px;
  background: var(--cu-sidebar);
  z-index: 100;
  transition: width .25s ease;
  display: flex;
  flex-direction: column;
}
.cu-sidebar.close { width: var(--cu-side-w-close); }
.cu-sidebar header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  margin-bottom: 8px;
}
.cu-sidebar .image-text {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.cu-sidebar .image img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  padding: 4px;
}
.cu-sidebar .logo-text .name {
  display: block;
  color: #f8fafc;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}
.cu-sidebar .logo-text .profession {
  display: block;
  color: #94a3b8;
  font-size: .8rem;
  white-space: nowrap;
}
.cu-sidebar.close .logo-text { opacity: 0; width: 0; pointer-events: none; }
.cu-sidebar .toggle {
  color: #e2e8f0;
  font-size: 1.5rem;
  cursor: pointer;
  flex-shrink: 0;
}
.cu-sidebar .menu-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  overflow-x: hidden;
}
.cu-sidebar .menu-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cu-sidebar .nav-link a {
  display: flex;
  align-items: center;
  height: 48px;
  border-radius: 10px;
  padding: 0 10px;
  margin-bottom: 4px;
  color: #e2e8f0;
  text-decoration: none;
  transition: background .15s ease;
}
.cu-sidebar .nav-link a:hover {
  background: rgba(56, 189, 248, 0.16);
}
.cu-sidebar .nav-link a.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(14, 165, 233, 0.9));
  color: #fff;
}
.cu-sidebar .nav-link .icon {
  font-size: 1.35rem;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cu-sidebar .nav-link .nav-text {
  white-space: nowrap;
  font-weight: 500;
  font-size: .95rem;
}
.cu-sidebar.close .nav-text { opacity: 0; width: 0; overflow: hidden; }
.cu-sidebar .bottom-content {
  list-style: none;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid rgba(148,163,184,.2);
}

/* —— Main —— */
.cu-home {
  position: relative;
  left: var(--cu-side-w);
  width: calc(100% - var(--cu-side-w));
  min-height: 100vh;
  transition: all .25s ease;
  padding: 18px 22px 40px;
}
.cu-sidebar.close ~ .cu-home {
  left: var(--cu-side-w-close);
  width: calc(100% - var(--cu-side-w-close));
}
.cu-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.cu-topbar h1 {
  margin: 0;
  font-size: 1.55rem;
  color: #0f172a;
  font-weight: 700;
}
.cu-topbar .sub {
  margin: 4px 0 0;
  color: var(--cu-muted);
  font-size: .95rem;
}
.cu-topbar .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--cu-line);
  border-radius: 12px;
  padding: 10px 14px;
}
.cu-topbar .user-chip strong { display: block; font-size: .95rem; }
.cu-topbar .user-chip span { color: var(--cu-muted); font-size: .85rem; }

.cu-card {
  background: var(--cu-card);
  border: 1px solid var(--cu-line);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.cu-card h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: #0f172a;
}
.cu-card p.muted { color: var(--cu-muted); margin: 0 0 10px; line-height: 1.55; font-size: .95rem; }

.cu-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.cu-kpi {
  background: #fff;
  border: 1px solid var(--cu-line);
  border-radius: 14px;
  padding: 16px 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.cu-kpi .label {
  display: block;
  color: var(--cu-muted);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.cu-kpi .value {
  display: block;
  margin-top: 8px;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
}
.cu-kpi a { color: inherit; text-decoration: none; }

.cu-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}
.cu-badge.ok { background: #dcfce7; color: #166534; }
.cu-badge.warn { background: #ffedd5; color: #9a3412; }
.cu-badge.muted { background: #e2e8f0; color: #475569; }
.cu-badge.danger { background: #fee2e2; color: #991b1b; }
.cu-badge.info { background: #e0f2fe; color: #075985; }

.cu-btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: .95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}
.cu-btn.sec {
  background: #e2e8f0;
  color: #334155;
}
.cu-btn.danger { background: #dc2626; }

.cu-form label {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--cu-muted);
  margin: 10px 0 4px;
}
.cu-form input,
.cu-form select {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--cu-line);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.cu-form .row-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

.cu-table-wrap { overflow-x: auto; }
.cu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.cu-table th {
  text-align: left;
  padding: 12px 10px;
  background: #3a647e;
  color: #fff;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.cu-table th:first-child { border-radius: 8px 0 0 0; }
.cu-table th:last-child { border-radius: 0 8px 0 0; }
.cu-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--cu-line);
  vertical-align: top;
}
.cu-table tr:hover td { background: #f8fafc; }

.cu-empty {
  text-align: center;
  padding: 28px 16px;
  border: 1px dashed var(--cu-line);
  border-radius: 12px;
  color: var(--cu-muted);
  font-size: .95rem;
}
.cu-empty strong { display: block; color: #0f172a; margin-bottom: 6px; font-size: 1.05rem; }

.cu-steps { display: grid; gap: 10px; margin: 14px 0; }
.cu-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--cu-line);
}
.cu-step i {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0369a1;
  font-style: normal;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cu-step b { display: block; color: #0f172a; font-size: .95rem; }
.cu-step span { color: var(--cu-muted); font-size: .9rem; }

.cu-linkbox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cu-linkbox input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--cu-line);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: .95rem;
  background: #f8fafc;
}

.cu-msg {
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: .95rem;
}
.cu-msg.ok { background: #ecfdf5; color: #065f46; }
.cu-msg.err { background: #fff1f2; color: #be123c; }

.cu-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cu-nav-badge {
  display: inline-block;
  margin-left: 4px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-style: normal;
  font-size: .72rem;
  font-weight: 800;
  padding: 2px 7px;
  vertical-align: middle;
}
.cu-mod-star {
  font-size: 0.72rem !important;
  color: #fbbf24 !important;
  margin-left: 4px;
  vertical-align: 1px;
  opacity: 0.95;
}
.sidebar .nav-link a:hover .cu-mod-star,
.sidebar .nav-link a.active .cu-mod-star,
.menu-links .nav-link a:hover .cu-mod-star,
.menu-links .nav-link a.active .cu-mod-star {
  color: #f59e0b !important;
}
.cu-bell-wrap { position: relative; }
.cu-bell-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--cu-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  color: #0f172a;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cu-bell-btn:hover { border-color: #93c5fd; color: #2563eb; }
.cu-bell-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cu-bell-count.is-zero { display: none; }
.cu-bell-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 92vw);
  background: #fff;
  border: 1px solid var(--cu-line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15,23,42,.18);
  z-index: 120;
  overflow: hidden;
}
.cu-bell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--cu-line);
  background: #f8fafc;
}
.cu-bell-head strong { font-size: 1rem; }
.cu-linkish {
  border: 0;
  background: none;
  color: #0369a1;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.cu-bell-list { max-height: 320px; overflow-y: auto; }
.cu-bell-item {
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f1f5f9;
}
.cu-bell-item i {
  font-size: 1.3rem;
  color: #0284c7;
  margin-top: 2px;
}
.cu-bell-item b { display: block; font-size: .95rem; color: #0f172a; }
.cu-bell-item span {
  display: block;
  font-size: .88rem;
  color: var(--cu-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.cu-bell-item small {
  display: block;
  margin-top: 4px;
  font-size: .78rem;
  color: #94a3b8;
}
.cu-bell-item.unread { background: #eff6ff; }
.cu-bell-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--cu-muted);
  font-size: .95rem;
}
.cu-bell-foot {
  display: block;
  text-align: center;
  padding: 12px;
  font-weight: 700;
  font-size: .95rem;
  color: #0369a1;
  text-decoration: none;
  border-top: 1px solid var(--cu-line);
  background: #f8fafc;
}
.cu-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cu-card-head h2 { margin: 0; }
.cu-card-head a { font-weight: 700; color: #0369a1; text-decoration: none; font-size: .95rem; }
.cu-notif-feed { display: grid; gap: 8px; }
.cu-notif-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--cu-line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.cu-notif-row:hover { border-color: #93c5fd; background: #f8fafc; }
.cu-notif-row.unread {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.cu-notif-ico {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.cu-notif-body { flex: 1; min-width: 0; }
.cu-notif-body b { display: block; font-size: 1rem; color: #0f172a; }
.cu-notif-body span {
  display: block;
  margin-top: 3px;
  font-size: .92rem;
  color: var(--cu-muted);
  line-height: 1.45;
}
.cu-notif-body small,
.cu-notif-row > small {
  color: #94a3b8;
  font-size: .82rem;
  white-space: nowrap;
}
.cu-notif-feed-full .cu-notif-row > small { display: none; }
.cu-wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
}
.cu-wallet-chip:hover { background: #dbeafe; }
.cu-wallet-chip i { font-size: 1.15rem; }
.cu-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.cu-subnav a {
  text-decoration: none;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: .86rem;
}
.cu-subnav a:hover { border-color: #93c5fd; color: #1d4ed8; }
.cu-modal[hidden] { display: none !important; }
.cu-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cu-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .5);
}
.cu-modal__box {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: 0 24px 50px rgba(15,23,42,.25);
}
.cu-modal__box h3 { margin: 0 0 8px; }
.cu-gf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.cu-gf-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  text-align: center;
}
.cu-gf-card__img {
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
}
.cu-gf-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cu-gf-card strong { font-size: 1.15rem; color: #0f172a; }
.cu-gf-card .cu-btn { width: 100%; justify-content: center; }
.cu-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  margin-top: 6px;
  flex-shrink: 0;
}

.cu-mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  background: #0f172a;
  color: #fff;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -18px -22px 16px;
}
.cu-mobile-bar > strong {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}
.cu-mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.cu-mobile-bar button,
.cu-mobile-cart {
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  min-height: 40px;
  min-width: 40px;
  line-height: 1;
}
.cu-mobile-wallet {
  font-family: inherit;
  font-size: 0.82rem !important;
  font-weight: 700;
  padding: 8px 11px !important;
  background: rgba(14, 165, 233, 0.28) !important;
  max-width: 42vw;
}
.cu-mobile-wallet span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cu-mobile-cart:hover,
.cu-mobile-bar button:hover {
  background: rgba(255,255,255,.2);
}

@media (max-width: 860px) {
  .cu-sidebar {
    transform: translateX(-105%);
    width: var(--cu-side-w) !important;
  }
  .cu-sidebar.open-mobile {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0,0,0,.35);
  }
  .cu-sidebar.close { width: var(--cu-side-w) !important; }
  .cu-sidebar.close .logo-text,
  .cu-sidebar.close .nav-text { opacity: 1; width: auto; }
  .cu-home,
  .cu-sidebar.close ~ .cu-home {
    left: 0;
    width: 100%;
    padding: 12px 12px 56px;
  }
  .cu-mobile-bar {
    display: flex;
    margin: -12px -12px 14px;
  }
  .cu-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .cu-topbar h1 { font-size: 1.25rem; }
  .cu-topbar-right .cu-wallet-chip { display: none; }
  .cu-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .cu-card {
    padding: 14px;
    border-radius: 14px;
  }
  .cu-btn {
    min-height: 44px;
    padding: 10px 14px;
  }
  .cu-form input,
  .cu-form select,
  .cu-form textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .cu-linkbox {
    flex-direction: column;
    align-items: stretch;
  }
  .cu-linkbox input { width: 100%; }
  .cu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 95;
  }
  .cu-overlay.show { display: block; }
}
