/* ============================================================
 * MKT Cotizador POS – CSS Unificado
 * Colores vibrantes, diseño elegante y profesional
 * ============================================================ */

:root {
  --mktpos-brand: #007f95;
  --mktpos-brand-rgb: 0 127 149;
  --mktpos-brand-weak: rgba(0,127,149,.14);
  --mktpos-brand-soft: rgba(0,127,149,.08);
  --mktpos-brand-border: rgba(0,127,149,.18);
  --mktpos-brand-bright: #21abc8;

  --mktpos-bg: #f7efe2;
  --mktpos-card: #ffffff;
  --mktpos-text: #1a1a2e;
  --mktpos-text-secondary: #555;
  --mktpos-text-muted: #888;
  --mktpos-border: #e7ddd1;
  --mktpos-radius: 18px;
  --mktpos-radius-sm: 8px;
  --mktpos-shadow: 0 12px 30px rgba(44, 28, 18, .08);
  --mktpos-shadow-lg: 0 18px 46px rgba(44, 28, 18, .12);

  /* Vibrant colors */
  --mktpos-success: #16925c;
  --mktpos-success-bg: #ddf8e9;
  --mktpos-danger: #cf4343;
  --mktpos-danger-bg: #fde8e7;
  --mktpos-warning: #ea6a2a;
  --mktpos-warning-bg: #fff0e6;
  --mktpos-info: #007f95;
  --mktpos-info-bg: #e2f8fc;
  --mktpos-purple: #8b43c5;
  --mktpos-purple-bg: #f3e8ff;
  --mktpos-emerald: #1cb38a;
  --mktpos-emerald-bg: #e4fbf4;

  /* Collapsible sidebar dimensions */
  --sb-w:   178px;  /* expanded width  */
  --sb-w-c:  62px;  /* collapsed width */
}

/* ============================================================
 * Reset & Base
 * ============================================================ */
/* A-CSS-1: solo aplicar fondo del plugin en las páginas del POS para no pisar el tema. */
body.mktpos-active,
body:has(.mktpos-wrap) {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top left, rgba(234,106,42,.14), transparent 26%),
    radial-gradient(circle at top right, rgba(33,171,200,.14), transparent 28%),
    linear-gradient(180deg, #fbf2e6 0%, var(--mktpos-bg) 100%);
}

.mktpos-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--mktpos-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background: transparent;
}
.mktpos-wrap *, .mktpos-wrap *::before, .mktpos-wrap *::after {
  box-sizing: border-box;
}
.mktpos-wrap h1, .mktpos-wrap h2, .mktpos-wrap h3, .mktpos-wrap h4 {
  margin: 0;
  font-weight: 700;
}
.mktpos-wrap p { margin: 0; }
.mktpos-wrap a { color: var(--mktpos-brand); text-decoration: none; }
.mktpos-wrap a:hover { text-decoration: underline; }
.mktpos-hidden { display: none !important; }

/* Sidebar-aware layout: pad content when sidebar is present */
.mktpos-wrap:has(.mktpos-sidebar) {
  padding-left: var(--sb-w);
  transition: padding-left .22s ease;
}
body.mktpos-sb-collapsed .mktpos-wrap:has(.mktpos-sidebar) {
  padding-left: var(--sb-w-c);
}
@media (max-width: 768px) {
  .mktpos-wrap:has(.mktpos-sidebar) {
    padding-left: 0 !important;
  }
  /* Space for fixed hamburger button on mobile */
  .mktpos-wrap:has(.mktpos-sidebar) .mktpos-content {
    padding-top: 56px;
  }
}

/* ============================================================
 * NAVBAR — redesigned (UX/UI v2)
 * ============================================================ */
.mktpos-navbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  height: 58px;
  background: #111827;            /* deep navy-black */
  border-bottom: 1px solid rgba(255,255,255,.07);
  border-radius: var(--mktpos-radius) var(--mktpos-radius) 0 0;
  margin-bottom: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  position: sticky;
  top: 0;
  z-index: 200;
}

/* ① Brand */
.mktpos-navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 8px;
}
.mktpos-nav-logo {
  height: 32px;
  width: auto;
  border-radius: 5px;
  object-fit: contain;
}
.mktpos-nav-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}

/* Thin separator between brand and links */
.mktpos-navbar-brand::after {
  content: '';
  display: block;
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.12);
  margin-left: 14px;
}

/* ② Nav links */
.mktpos-navbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.mktpos-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 7px;
  color: rgba(255,255,255,.6) !important;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none !important;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.mktpos-nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,.09);
  text-decoration: none !important;
}
.mktpos-nav-active {
  color: #fff !important;
  background: rgba(255,255,255,.13) !important;
  font-weight: 600;
}
.mktpos-nav-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: .85;
}
.mktpos-nav-active .mktpos-nav-icon {
  opacity: 1;
}

/* ③ Right actions area */
.mktpos-navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 12px;
}

/* CTA pill — Nueva cotización */
.mktpos-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  background: linear-gradient(135deg, #e76f51 0%, #f4a261 100%);
  color: #fff !important;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: filter .15s, transform .15s;
  white-space: nowrap;
}
.mktpos-nav-cta:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  text-decoration: none !important;
}
.mktpos-nav-cta-active {
  filter: brightness(1.15);
  box-shadow: 0 0 0 2px rgba(247,159,100,.5);
}

/* User avatar button */
.mktpos-nav-user {
  position: relative;
}
.mktpos-nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, transform .15s;
  letter-spacing: .5px;
}
.mktpos-nav-avatar:hover {
  border-color: rgba(255,255,255,.55);
  transform: scale(1.06);
}
.mktpos-nav-avatar[aria-expanded="true"] {
  border-color: #a5b4fc;
}

/* Dropdown panel */
.mktpos-nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.07);
  z-index: 400;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(.97);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.mktpos-nav-dropdown.mktpos-dropdown-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.mktpos-dropdown-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8f9ff, #ede9ff);
}
.mktpos-dropdown-avatar-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .5px;
}
.mktpos-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.mktpos-dropdown-info strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mktpos-dropdown-role {
  font-size: 11px;
  color: #6366f1;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.mktpos-dropdown-email {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mktpos-dropdown-divider {
  height: 1px;
  background: #f3f4f6;
}
.mktpos-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  font-size: 13.5px;
  color: #374151 !important;
  text-decoration: none !important;
  transition: background .12s;
}
.mktpos-dropdown-item:hover {
  background: #f9fafb;
  text-decoration: none !important;
}
.mktpos-dropdown-logout {
  color: #dc2626 !important;
}
.mktpos-dropdown-logout:hover {
  background: #fef2f2 !important;
}

/* Hamburger button (hidden on desktop) */
.mktpos-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  padding: 0;
  transition: background .15s;
}
.mktpos-hamburger:hover { background: rgba(255,255,255,.14); }
.mktpos-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: transform .22s, opacity .22s;
  transform-origin: center;
}
/* Animated X when open */
.mktpos-hamburger.mktpos-nav-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mktpos-hamburger.mktpos-nav-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mktpos-hamburger.mktpos-nav-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
 * COLLAPSIBLE SIDEBAR
 * ============================================================ */
.mktpos-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sb-w);
  background:
    linear-gradient(180deg, rgba(11, 28, 40, 0.99), rgba(15, 34, 48, 0.95)),
    linear-gradient(180deg, rgba(234,106,42,.14), transparent 34%);
  display: flex;
  flex-direction: column;
  z-index: 300;
  /* overflow: hidden intentionally omitted so dropdown menus can escape the sidebar */
  transition: width .22s ease;
  box-shadow: 10px 0 30px rgba(16, 23, 34, .16);
}
.mktpos-sidebar.mktpos-sb-collapsed {
  width: var(--sb-w-c);
}

/* ── Brand section ── */
.mktpos-sb-brand {
  padding: 18px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
}
.mktpos-sb-brand-static,
.mktpos-sb-brand-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}
.mktpos-sb-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}
.mktpos-sb-logo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--mktpos-warning, #ea6a2a), #ffb56d);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mktpos-sb-brand-name {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
  transition: opacity .18s, max-width .22s;
  max-width: 160px;
}
.mktpos-sidebar.mktpos-sb-collapsed .mktpos-sb-brand-name {
  opacity: 0;
  max-width: 0;
}

/* Brand picker button */
.mktpos-sb-brand-picker { position: relative; }
.mktpos-sb-brand-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  min-width: 0;
  flex: 1;
}
.mktpos-sb-brand-caret {
  flex-shrink: 0;
  opacity: .6;
  transition: transform .2s, opacity .18s;
}
.mktpos-sidebar.mktpos-sb-collapsed .mktpos-sb-brand-caret { opacity: 0; }
.mktpos-sb-brand-btn[aria-expanded="true"] .mktpos-sb-brand-caret { transform: rotate(180deg); }

/* Brand picker dropdown — opens to the right */
.mktpos-sb-brand-picker .mktpos-brand-picker-dropdown {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  min-width: 200px;
}
.mktpos-sidebar.mktpos-sb-collapsed .mktpos-sb-brand-picker .mktpos-brand-picker-dropdown {
  left: calc(var(--sb-w-c) - 12px + 10px);
}

/* ── Navigation links ── */
.mktpos-sb-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.mktpos-sb-nav::-webkit-scrollbar { display: none; }

.mktpos-sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  color: rgba(255,255,255,.6) !important;
  text-decoration: none !important;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s, transform .15s, border-color .15s;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.mktpos-sb-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff !important;
  text-decoration: none !important;
  transform: translateX(2px);
}
.mktpos-sb-active {
  background: linear-gradient(135deg, rgba(234,106,42,.24), rgba(33,171,200,.18)) !important;
  color: #fff !important;
  font-weight: 600;
  border-color: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.mktpos-sb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  opacity: .8;
}
.mktpos-sb-active .mktpos-sb-icon,
.mktpos-sb-link:hover .mktpos-sb-icon { opacity: 1; }

.mktpos-sb-label {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity .18s, max-width .22s;
  max-width: 160px;
}
.mktpos-sidebar.mktpos-sb-collapsed .mktpos-sb-label {
  opacity: 0;
  max-width: 0;
}

/* ── Nueva cotización CTA ── */
.mktpos-sb-cta-wrap {
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.mktpos-sb-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: linear-gradient(135deg, #ef6120 0%, #ffbf6e 100%);
  color: #fff !important;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: filter .15s, transform .15s, box-shadow .15s;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(234,106,42,.24);
}
.mktpos-sb-cta:hover { filter: brightness(1.05); transform: translateY(-1px); text-decoration: none !important; }

/* ── Footer: user + toggle ── */
.mktpos-sb-footer {
  padding: 8px 8px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

/* User section */
.mktpos-sb-user { position: relative; margin-bottom: 4px; }
.mktpos-sb-avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px 10px;
  border-radius: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background .15s;
  text-align: left;
}
.mktpos-sb-avatar-btn:hover { background: rgba(255,255,255,.08); }
.mktpos-sb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--mktpos-brand-bright), var(--mktpos-brand));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .5px;
}
.mktpos-sb-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: opacity .18s, max-width .22s;
  max-width: 160px;
}
.mktpos-sidebar.mktpos-sb-collapsed .mktpos-sb-user-info {
  opacity: 0;
  max-width: 0;
}
.mktpos-sb-user-name {
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mktpos-sb-user-role {
  color: rgba(255,255,255,.45);
  font-size: 10.5px;
  white-space: nowrap;
}

/* User dropdown — opens to the right */
.mktpos-sb-user-dropdown {
  position: absolute;
  bottom: 0;
  left: calc(100% + 8px);
  width: 240px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.07);
  z-index: 500;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-6px) scale(.97);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.mktpos-sb-user-dropdown.mktpos-dropdown-open {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}
.mktpos-sidebar.mktpos-sb-collapsed .mktpos-sb-user-dropdown {
  left: calc(var(--sb-w-c) - 8px + 8px);
}

/* Collapse toggle button */
.mktpos-sb-toggle {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: rgba(255,255,255,.3);
  transition: background .15s, color .15s;
  margin-top: 2px;
}
.mktpos-sb-toggle:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.65);
}
.mktpos-sb-toggle-icon { transition: transform .22s ease; }
.mktpos-sidebar.mktpos-sb-collapsed .mktpos-sb-toggle-icon {
  transform: rotate(180deg);
}
.mktpos-sidebar.mktpos-sb-collapsed .mktpos-sb-toggle {
  justify-content: center;
}

/* ── Mobile overlay ── */
.mktpos-sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 290;
}
.mktpos-sb-overlay.mktpos-sb-open { display: block; }

/* ── Mobile hamburger ── */
.mktpos-sb-hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 350;
  width: 38px;
  height: 38px;
  background: #111827;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  padding: 0;
}
.mktpos-sb-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: transform .22s, opacity .22s;
  transform-origin: center;
}
.mktpos-sb-hamburger.mktpos-sb-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mktpos-sb-hamburger.mktpos-sb-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mktpos-sb-hamburger.mktpos-sb-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .mktpos-sb-hamburger { display: flex; }
  .mktpos-sb-toggle    { display: none; }

  .mktpos-sidebar {
    width: var(--sb-w) !important;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .mktpos-sidebar.mktpos-sb-mobile-open {
    transform: translateX(0);
  }
}

/* ============================================================
 * APP FOOTER
 * ============================================================ */
.mktpos-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  margin-top: 32px;
  border-top: 1px solid var(--mktpos-border);
  font-size: 12px;
  color: #9ca3af;
}
.mktpos-footer-brand {
  font-weight: 600;
  color: #6b7280;
}
.mktpos-footer-sep {
  color: #d1d5db;
}

/* Content area */
.mktpos-content {
  padding: 24px 24px 8px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ============================================================
 * BUTTONS
 * ============================================================ */
.mktpos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none !important;
  white-space: nowrap;
  line-height: 1.4;
}
.mktpos-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.mktpos-btn:active { transform: translateY(0); }
.mktpos-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.mktpos-btn-primary { background: linear-gradient(135deg, #e76f51 0%, #f4a261 100%); color: #fff !important; border: none; }
.mktpos-btn-primary { background: linear-gradient(135deg, #ef6120 0%, #ffbf6e 100%); color: #fff !important; border: none; box-shadow: 0 12px 24px rgba(234,106,42,.18); }
.mktpos-btn-primary:hover { background: linear-gradient(135deg, #df5719 0%, #ffb156 100%); color: #fff !important; }

.mktpos-btn-success { background: var(--mktpos-success); color: #fff !important; }
.mktpos-btn-success:hover { background: #1b4332; color: #fff !important; }

.mktpos-btn-danger { background: var(--mktpos-danger); color: #fff !important; }
.mktpos-btn-danger:hover { background: #c1121f; color: #fff !important; }

.mktpos-btn-warning { background: var(--mktpos-warning); color: #fff !important; }
.mktpos-btn-warning:hover { background: #e76f51; color: #fff !important; }

.mktpos-btn-ghost {
  background: transparent;
  color: var(--mktpos-text) !important;
  border: 1.5px solid rgba(31,41,55,.10);
}
.mktpos-btn-ghost:hover { background: rgba(255,255,255,.85); }

.mktpos-btn-full { width: 100%; }

.mktpos-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ============================================================
 * INPUTS
 * ============================================================ */
.mktpos-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--mktpos-border);
  border-radius: var(--mktpos-radius-sm);
  font-size: 14px;
  color: var(--mktpos-text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  font-family: inherit;
}
.mktpos-input:focus {
  border-color: var(--mktpos-brand);
  box-shadow: 0 0 0 3px var(--mktpos-brand-weak);
}
select.mktpos-input { cursor: pointer; }
textarea.mktpos-input { resize: vertical; }

/* ============================================================
 * CARDS
 * ============================================================ */
.mktpos-card {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,250,245,.90));
  border-radius: var(--mktpos-radius);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: var(--mktpos-shadow);
  overflow: hidden;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
}
.mktpos-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(31,41,55,.08);
  flex-wrap: wrap;
  gap: 12px;
}
.mktpos-card-header h3 {
  font-size: 17px;
  color: var(--mktpos-text);
  letter-spacing: -.02em;
}
.mktpos-card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--mktpos-border);
}
.mktpos-card-action {
  border-left: 4px solid var(--mktpos-brand);
}
.mktpos-card-sticky {
  position: sticky;
  top: 20px;
}

/* ============================================================
 * BADGES
 * ============================================================ */
.mktpos-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.mktpos-badge-brand {
  background: var(--mktpos-brand);
  color: #fff;
}
.mktpos-badge-seller {
  background: var(--mktpos-info-bg);
  color: var(--mktpos-info);
}
.mktpos-badge-draft { background: #6c757d; color: #fff; }
.mktpos-badge-advance { background: #f4a261; color: #fff; }
.mktpos-badge-processing { background: #0077b6; color: #fff; }
.mktpos-badge-completed { background: #2d6a4f; color: #fff; }
.mktpos-badge-cancelled { background: #e63946; color: #fff; }
.mktpos-badge-pending { background: #6c757d20; color: #6c757d; border: 1px solid #6c757d40; }
.mktpos-badge-partial { background: #f4a26120; color: #e76f51; border: 1px solid #f4a26140; }
.mktpos-badge-fulfilled { background: #2d6a4f20; color: #2d6a4f; border: 1px solid #2d6a4f40; }
.mktpos-badge-backorder { background: #e6394620; color: #e63946; border: 1px solid #e6394640; }

/* ============================================================
 * PAGE LAYOUT
 * ============================================================ */
.mktpos-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.mktpos-page-header h1 {
  font-size: 34px;
  color: var(--mktpos-text);
  letter-spacing: -.05em;
  line-height: 1.02;
}
.mktpos-subtitle {
  color: var(--mktpos-text-secondary);
  margin-top: 8px;
  font-size: 14px;
}
.mktpos-hero-kicker {
  display: inline-block;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(0,127,149,.10);
  border: 1px solid rgba(0,127,149,.14);
  color: var(--mktpos-brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ============================================================
 * LOGIN PAGE
 * ============================================================ */
.mktpos-page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 20px;
}
.mktpos-login-container {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
}
.mktpos-login-header {
  background: linear-gradient(135deg, #e63946 0%, #f4a261 100%);
  padding: 40px 32px 32px;
  text-align: center;
}
.mktpos-login-icon {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  backdrop-filter: blur(8px);
}
.mktpos-login-header h1 {
  color: #fff;
  font-size: 24px;
  margin-bottom: 4px;
}
.mktpos-login-header p {
  color: rgba(255,255,255,.85);
  font-size: 14px;
}
.mktpos-login-form {
  padding: 32px;
}
.mktpos-field {
  margin-bottom: 20px;
}
.mktpos-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mktpos-text);
  margin-bottom: 6px;
}
.mktpos-input-icon {
  position: relative;
}
.mktpos-input-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mktpos-text-muted);
}
.mktpos-input-icon input {
  padding-left: 42px;
}
.mktpos-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.mktpos-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--mktpos-text-secondary);
  cursor: pointer;
}
.mktpos-link {
  font-size: 13px;
  color: var(--mktpos-danger) !important;
  font-weight: 500;
}
.mktpos-recover-header {
  margin-bottom: 20px;
}
.mktpos-recover-header h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.mktpos-recover-header p {
  font-size: 14px;
  color: var(--mktpos-text-secondary);
}
.mktpos-login-footer {
  text-align: center;
  padding: 16px;
  background: #f8f9fa;
  border-top: 1px solid var(--mktpos-border);
}
.mktpos-login-footer p {
  font-size: 12px;
  color: var(--mktpos-text-muted);
}

/* Alerts */
.mktpos-alert {
  padding: 12px 20px;
  margin: 0 32px;
  border-radius: var(--mktpos-radius-sm);
  font-size: 14px;
  font-weight: 500;
}
.mktpos-alert-error {
  background: var(--mktpos-danger-bg);
  color: var(--mktpos-danger);
  border: 1px solid #e6394630;
}
.mktpos-alert-success {
  background: var(--mktpos-success-bg);
  color: var(--mktpos-success);
  border: 1px solid #2d6a4f30;
}

/* ============================================================
 * PANEL (Products Grid)
 * ============================================================ */
.mktpos-search-bar {
  display: flex;
  gap: 8px;
}
.mktpos-search-bar .mktpos-input {
  width: 260px;
}
.mktpos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.mktpos-product-card {
  background: var(--mktpos-card);
  border-radius: var(--mktpos-radius);
  box-shadow: var(--mktpos-shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.mktpos-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--mktpos-shadow-lg);
}
.mktpos-product-img {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f8f9fa;
}
.mktpos-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mktpos-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mktpos-text-muted);
  font-size: 14px;
}
.mktpos-product-info {
  padding: 16px;
}
.mktpos-product-info h3 {
  font-size: 15px;
  margin-bottom: 8px;
  line-height: 1.3;
}
.mktpos-product-price {
  margin-bottom: 8px;
}
.mktpos-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--mktpos-success);
}
.mktpos-price-old {
  font-size: 14px;
  color: var(--mktpos-text-muted);
  text-decoration: line-through;
  margin-right: 8px;
}
.mktpos-price-sale {
  font-size: 18px;
  font-weight: 700;
  color: var(--mktpos-danger);
}
.mktpos-stock {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px;
}
.mktpos-in-stock { background: var(--mktpos-success-bg); color: var(--mktpos-success); }
.mktpos-no-stock { background: var(--mktpos-danger-bg); color: var(--mktpos-danger); }
.mktpos-sku {
  display: block;
  font-size: 12px;
  color: var(--mktpos-text-muted);
  margin-top: 4px;
}

/* Pagination */
.mktpos-pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}
.mktpos-page-btn {
  padding: 8px 14px;
  border: 1.5px solid var(--mktpos-border);
  border-radius: 8px;
  background: #fff;
  color: var(--mktpos-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none !important;
}
.mktpos-page-btn:hover { background: var(--mktpos-bg); }
.mktpos-page-active {
  background: var(--mktpos-brand) !important;
  color: #fff !important;
  border-color: var(--mktpos-brand) !important;
}

/* Empty state */
.mktpos-empty-state {
  text-align: center;
  padding: 60px 20px;
}
.mktpos-empty-state h3 {
  margin-top: 16px;
  color: var(--mktpos-text-secondary);
}
.mktpos-empty-state p {
  color: var(--mktpos-text-muted);
  margin-top: 8px;
}

/* ============================================================
 * BUILDER
 * ============================================================ */
.mktpos-builder-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
}
.mktpos-form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
}
.mktpos-field-full { width: 100%; }
.mktpos-field-half { width: calc(50% - 8px); }
.mktpos-field-third { width: calc(33.33% - 11px); }
.mktpos-field-twothirds { width: calc(66.66% - 5px); }
.mktpos-form-grid label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mktpos-text);
  margin-bottom: 4px;
}
.mktpos-req { color: var(--mktpos-danger); }

/* Mode switch */
.mktpos-mode-switch {
  display: flex;
  gap: 8px;
}
.mktpos-radio-pill {
  cursor: pointer;
}
.mktpos-radio-pill input { display: none; }
.mktpos-radio-pill span {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--mktpos-bg);
  color: var(--mktpos-text-secondary);
  transition: all .2s;
  border: 1.5px solid transparent;
}
.mktpos-radio-pill input:checked + span {
  background: var(--mktpos-brand);
  color: #fff;
  border-color: var(--mktpos-brand);
}

/* Inline search */
.mktpos-inline-search {
  display: flex;
  gap: 8px;
}
.mktpos-inline-search .mktpos-input {
  width: 260px;
}

/* Search results */
.mktpos-products-results {
  padding: 16px 20px;
  max-height: 500px;
  overflow-y: auto;
}
.mktpos-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.mktpos-search-item {
  display: flex;
  flex-direction: column;
  background: var(--mktpos-bg);
  border-radius: var(--mktpos-radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
}
.mktpos-search-item:hover {
  border-color: var(--mktpos-brand);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.mktpos-in-cart {
  border-color: var(--mktpos-success) !important;
  background: var(--mktpos-success-bg) !important;
}
.mktpos-search-img {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: #f0f0f5;
}
.mktpos-search-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mktpos-search-info {
  padding: 10px 12px;
  flex: 1;
}
.mktpos-search-info h4 {
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.3;
}
.mktpos-search-price {
  margin-bottom: 4px;
}
.mktpos-search-price .mktpos-price { font-size: 15px; }
.mktpos-search-price .mktpos-price-sale { font-size: 15px; }
.mktpos-search-price .mktpos-price-old { font-size: 12px; }
.mktpos-prod-stock {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.mktpos-sku-label {
  display: block;
  font-size: 11px;
  color: var(--mktpos-text-muted);
  margin-top: 2px;
}
.mktpos-search-action {
  padding: 8px 12px;
  text-align: center;
}
.mktpos-added-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mktpos-success);
}
.mktpos-add-btn {
  width: 100%;
}
.mktpos-tip {
  padding: 12px 20px;
  background: var(--mktpos-warning-bg);
  border-left: 4px solid var(--mktpos-warning);
  font-size: 13px;
  color: var(--mktpos-text-secondary);
}
.mktpos-empty-hint {
  text-align: center;
  padding: 32px 16px;
  color: var(--mktpos-text-muted);
}
.mktpos-empty-hint svg { margin-bottom: 8px; }

/* Cart lines */
.mktpos-total-display {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mktpos-total-display span {
  font-size: 14px;
  color: var(--mktpos-text-secondary);
}
.mktpos-total-display strong {
  font-size: 22px;
  color: var(--mktpos-danger);
}
.mktpos-lines {
  padding: 12px 20px;
  max-height: 400px;
  overflow-y: auto;
}
.mktpos-line-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--mktpos-border);
}
.mktpos-line-item:last-child { border-bottom: none; }
.mktpos-line-info {
  margin-bottom: 8px;
}
.mktpos-line-info strong {
  font-size: 14px;
}
.mktpos-line-info small {
  color: var(--mktpos-text-muted);
}
.mktpos-line-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.mktpos-line-field {
  flex: 1;
  min-width: 60px;
}
.mktpos-line-field label {
  display: block;
  font-size: 11px;
  color: var(--mktpos-text-muted);
  margin-bottom: 2px;
}
.mktpos-line-field .mktpos-input {
  padding: 6px 8px;
  font-size: 13px;
}
.mktpos-line-sub {
  min-width: 80px;
  text-align: right;
}
.mktpos-line-sub label {
  display: block;
  font-size: 11px;
  color: var(--mktpos-text-muted);
  margin-bottom: 2px;
}
.mktpos-line-sub span {
  font-size: 15px;
  font-weight: 700;
  color: var(--mktpos-success);
}
.mktpos-line-remove {
  background: var(--mktpos-danger);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.mktpos-line-remove:hover { background: #c1121f; }

.mktpos-summary-stats {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  background: var(--mktpos-bg);
  border-top: 1px solid var(--mktpos-border);
}
.mktpos-stat-item {
  display: flex;
  gap: 4px;
  font-size: 13px;
}
.mktpos-stat-item span { color: var(--mktpos-text-muted); }
.mktpos-stat-item strong { color: var(--mktpos-text); }

.mktpos-save-msg {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
}

/* ============================================================
 * QUOTE VIEW
 * ============================================================ */
.mktpos-quote-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.mktpos-quote-header h1 {
  font-size: 28px;
}
.mktpos-quote-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.mktpos-meta-text {
  font-size: 13px;
  color: var(--mktpos-text-muted);
}
.mktpos-quote-header-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mktpos-quote-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* Info cards */
.mktpos-info-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.mktpos-info-card {
  background: var(--mktpos-card);
  border-radius: var(--mktpos-radius);
  padding: 20px;
  box-shadow: var(--mktpos-shadow);
}
.mktpos-info-card h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mktpos-text-muted);
  margin-bottom: 8px;
}
.mktpos-info-main {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px !important;
}
.mktpos-info-card p {
  font-size: 13px;
  color: var(--mktpos-text-secondary);
}
.mktpos-info-total {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
}
.mktpos-info-total h4 { color: rgba(255,255,255,.6); }
.mktpos-info-total p { color: rgba(255,255,255,.8); }
.mktpos-info-big {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #fff !important;
}
.mktpos-info-sub {
  font-size: 12px !important;
  margin-top: 8px !important;
}

/* Progress bar */
.mktpos-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,.2);
  border-radius: 4px;
  margin: 12px 0 4px;
  overflow: hidden;
}
.mktpos-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

/* Items table */
.mktpos-items-table {
  padding: 0;
  overflow-x: auto;
}
.mktpos-items-table table {
  width: 100%;
  border-collapse: collapse;
}
.mktpos-items-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mktpos-text-muted);
  background: var(--mktpos-bg);
  border-bottom: 2px solid var(--mktpos-border);
}
.mktpos-items-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--mktpos-border);
  vertical-align: middle;
}
.mktpos-items-table tfoot td {
  border-bottom: none;
  padding-top: 16px;
}
.mktpos-notes-block {
  padding: 16px 20px;
  background: var(--mktpos-warning-bg);
  border-top: 1px solid var(--mktpos-border);
  font-size: 14px;
}

/* Payments */
.mktpos-payments-list {
  padding: 12px 20px;
  max-height: 300px;
  overflow-y: auto;
}
.mktpos-payment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--mktpos-border);
}
.mktpos-payment-item:last-child { border-bottom: none; }
.mktpos-payment-info strong {
  display: block;
  font-size: 14px;
}
.mktpos-payment-info span {
  font-size: 12px;
  color: var(--mktpos-text-muted);
}
.mktpos-payment-info small {
  display: block;
  font-size: 11px;
  color: var(--mktpos-text-muted);
}
.mktpos-payment-amount {
  font-size: 16px;
  font-weight: 700;
}
.mktpos-amount-positive { color: var(--mktpos-success); }
.mktpos-amount-negative { color: var(--mktpos-danger); }
.mktpos-payment-refund {
  background: var(--mktpos-danger-bg);
  padding: 10px 12px !important;
  border-radius: 8px;
  margin: 4px 0;
}

/* Notes */
.mktpos-notes-list {
  padding: 12px 20px;
  max-height: 250px;
  overflow-y: auto;
}
.mktpos-note-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--mktpos-border);
}
.mktpos-note-item:last-child { border-bottom: none; }
.mktpos-note-meta {
  font-size: 12px;
  color: var(--mktpos-text-muted);
  margin-bottom: 4px;
}
.mktpos-note-text {
  font-size: 14px;
}
.mktpos-note-form {
  padding: 12px 20px;
  border-top: 1px solid var(--mktpos-border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.mktpos-note-form textarea {
  flex: 1;
}
.mktpos-empty-text {
  text-align: center;
  color: var(--mktpos-text-muted);
  font-size: 14px;
  padding: 16px 0;
}

/* Action buttons */
.mktpos-action-buttons {
  padding: 16px 20px;
}

/* ============================================================
 * KPI CARDS (Dashboard)
 * ============================================================ */
.mktpos-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.mktpos-kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  box-shadow: 0 16px 30px rgba(44, 28, 18, .10);
  transition: transform .2s, box-shadow .2s;
  border: 1px solid rgba(255,255,255,.18);
}
.mktpos-kpi-card:hover { transform: translateY(-3px); box-shadow: 0 22px 36px rgba(44, 28, 18, .13); }
.mktpos-kpi-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mktpos-kpi-data {
  min-width: 0;
  flex: 1;
}
.mktpos-kpi-value {
  display: block;
  font-size: clamp(16px, 1.2vw, 20px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.05;
  white-space: nowrap;
}
.mktpos-kpi-label {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.25;
}

/* KPI Colors - VIBRANT */
.mktpos-kpi-blue {
  background: linear-gradient(135deg, #007f95 0%, #21abc8 100%);
  color: #fff;
}
.mktpos-kpi-blue .mktpos-kpi-icon { background: rgba(255,255,255,.2); }
.mktpos-kpi-blue .mktpos-kpi-label { color: rgba(255,255,255,.8); }

.mktpos-kpi-green {
  background: linear-gradient(135deg, #16925c 0%, #58d39d 100%);
  color: #fff;
}
.mktpos-kpi-green .mktpos-kpi-icon { background: rgba(255,255,255,.2); }
.mktpos-kpi-green .mktpos-kpi-label { color: rgba(255,255,255,.8); }

.mktpos-kpi-orange {
  background: linear-gradient(135deg, #ea6a2a 0%, #ffbf6e 100%);
  color: #fff;
}
.mktpos-kpi-orange .mktpos-kpi-icon { background: rgba(255,255,255,.2); }
.mktpos-kpi-orange .mktpos-kpi-label { color: rgba(255,255,255,.8); }

.mktpos-kpi-emerald {
  background: linear-gradient(135deg, #1cb38a 0%, #71e5c3 100%);
  color: #fff;
}
.mktpos-kpi-emerald .mktpos-kpi-icon { background: rgba(255,255,255,.2); }
.mktpos-kpi-emerald .mktpos-kpi-label { color: rgba(255,255,255,.8); }

.mktpos-kpi-purple {
  background: linear-gradient(135deg, #8b43c5 0%, #ca6ce2 100%);
  color: #fff;
}
.mktpos-kpi-purple .mktpos-kpi-icon { background: rgba(255,255,255,.2); }
.mktpos-kpi-purple .mktpos-kpi-label { color: rgba(255,255,255,.8); }

.mktpos-kpi-red {
  background: linear-gradient(135deg, #cf4343 0%, #f58d83 100%);
  color: #fff;
}
.mktpos-kpi-red .mktpos-kpi-icon { background: rgba(255,255,255,.2); }
.mktpos-kpi-red .mktpos-kpi-label { color: rgba(255,255,255,.8); }

/* ============================================================
 * Seller Performance Panel (Super Admin Dashboard)
 * ============================================================ */
.mktpos-seller-panel { margin-bottom: 24px; }
.mktpos-seller-panel .mktpos-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(31,41,55,.08);
}
.mktpos-seller-panel .mktpos-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--mktpos-text);
}
.mktpos-seller-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 20px 24px 24px;
}
.mktpos-seller-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,242,234,.92) 100%);
  border-radius: 20px;
  border: 1px solid rgba(31,41,55,.08);
  border-left: 4px solid var(--mktpos-brand, #007f95);
  transition: transform .15s, box-shadow .15s;
}
.mktpos-seller-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.mktpos-seller-avatar {
  flex-shrink: 0;
}
.mktpos-seller-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--mktpos-brand, #0077b6);
}
.mktpos-seller-info {
  flex: 1;
  min-width: 120px;
}
.mktpos-seller-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--mktpos-text);
}
.mktpos-seller-info small {
  color: var(--mktpos-text-muted);
  font-size: 12px;
}
.mktpos-seller-stats {
  display: flex;
  gap: 16px;
  width: 100%;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--mktpos-border);
}
.mktpos-seller-stat {
  text-align: center;
  flex: 1;
}
.mktpos-seller-stat-value {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--mktpos-text);
}
.mktpos-seller-stat-label {
  display: block;
  font-size: 11px;
  color: var(--mktpos-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}
.mktpos-text-green { color: #16925c !important; }
.mktpos-text-emerald { color: #1cb38a !important; }
.mktpos-text-orange { color: #ea6a2a !important; }
.mktpos-text-danger { color: #cf4343 !important; }
.mktpos-text-blue { color: #007f95 !important; }
.mktpos-text-purple { color: #8b43c5 !important; }

.mktpos-badge-brand {
  background: linear-gradient(135deg, var(--mktpos-brand, #007f95), var(--mktpos-brand-bright, #21abc8)) !important;
  color: #fff !important;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}

/* ============================================================
 * DASHBOARD TABLE
 * ============================================================ */
.mktpos-dash-filters {
  flex-wrap: wrap;
}
.mktpos-page-dashboard .mktpos-content {
  max-width: 1620px;
}
.mktpos-dashboard-hero {
  margin-bottom: 24px;
  padding: 24px 24px 20px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(255,191,110,.24), transparent 26%),
    radial-gradient(circle at left bottom, rgba(33,171,200,.12), transparent 32%),
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,248,240,.82));
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: var(--mktpos-shadow-lg);
  backdrop-filter: blur(14px);
}
.mktpos-dashboard-overline {
  margin: 0 0 8px;
  color: var(--mktpos-brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
}
.mktpos-dashboard-header {
  margin-bottom: 10px;
}
.mktpos-dashboard-header-main {
  margin-bottom: 18px;
}
.mktpos-dashboard-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mktpos-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mktpos-filter-select {
  width: 180px;
}
.mktpos-dash-table-wrap {
  overflow-x: hidden;
  padding: 0 10px 18px;
}
.mktpos-table-scroll {
  overflow-x: auto;
}
.mktpos-dash-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,.82);
  border-radius: 18px;
  overflow: hidden;
}
.mktpos-dash-table th {
  padding: 14px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mktpos-text-muted);
  background: #fbf1e7;
  border-bottom: 1px solid rgba(31,41,55,.10);
  white-space: nowrap;
}
.mktpos-dash-table td {
  padding: 14px 14px;
  font-size: 14px;
  border-bottom: 1px solid rgba(31,41,55,.08);
  vertical-align: middle;
}
.mktpos-dash-table tr:hover td {
  background: rgba(0,127,149,.06);
}
.mktpos-dash-actions {
  white-space: nowrap;
}
.mktpos-dash-actions .mktpos-btn {
  margin-right: 4px;
}
/* ── Dashboard footer: per-page selector left, pagination right ── */
.mktpos-dash-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(31,41,55,.08);
  background: transparent;
}
.mktpos-per-page-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mktpos-per-page-label {
  font-size: 12px;
  color: var(--mktpos-text-muted, #888);
  white-space: nowrap;
}
.mktpos-per-page-sel {
  height: 30px;
  padding: 0 8px;
  border: 1.5px solid var(--mktpos-border);
  border-radius: 7px;
  font-size: 12px;
  background: var(--mktpos-card);
  color: var(--mktpos-text);
  cursor: pointer;
  outline: none;
}
.mktpos-per-page-sel:focus { border-color: var(--mktpos-brand); }
.mktpos-dash-count {
  font-size: 12px;
  color: var(--mktpos-text-muted, #888);
  white-space: nowrap;
}
.mktpos-dash-pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.mktpos-page-ellipsis {
  font-size: 13px;
  color: var(--mktpos-text-muted, #aaa);
  padding: 0 2px;
}
.mktpos-loading {
  text-align: center;
  padding: 40px;
  color: var(--mktpos-text-muted);
  font-size: 15px;
}

/* ============================================================
 * REPORTS
 * ============================================================ */
.mktpos-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mktpos-date-range label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mktpos-text-secondary);
}
.mktpos-date-range .mktpos-input {
  width: 160px;
}
.mktpos-report-section {
  margin-bottom: 32px;
}
.mktpos-section-title {
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--mktpos-brand);
  display: inline-block;
}
.mktpos-report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.mktpos-report-card {
  background: var(--mktpos-card);
  border-radius: var(--mktpos-radius);
  padding: 20px;
  box-shadow: var(--mktpos-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mktpos-report-method {
  font-size: 14px;
  font-weight: 600;
}
.mktpos-report-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--mktpos-text);
}
.mktpos-report-total {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
}
.mktpos-report-total .mktpos-report-method { color: rgba(255,255,255,.7); }
.mktpos-report-total .mktpos-report-amount { color: #fff; }

.mktpos-report-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--mktpos-card);
  border-radius: var(--mktpos-radius);
  overflow: hidden;
  box-shadow: var(--mktpos-shadow);
}
.mktpos-report-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mktpos-text-muted);
  background: var(--mktpos-bg);
  border-bottom: 2px solid var(--mktpos-border);
}
.mktpos-report-table td {
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--mktpos-border);
}
.mktpos-report-table tr:hover td {
  background: var(--mktpos-brand-soft);
}
.mktpos-report-table a {
  font-weight: 600;
}

.mktpos-analytics-shell {
  background: #ffffff;
  border: 1px solid var(--mktpos-border);
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  overflow: hidden;
}
.mktpos-analytics-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.mktpos-analytics-copy {
  margin-top: 10px;
  max-width: 760px;
  color: var(--mktpos-text-secondary);
  line-height: 1.6;
}
.mktpos-analytics-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px 12px;
  min-width: 280px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--mktpos-border);
}
.mktpos-analytics-filters label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mktpos-text-muted);
}
.mktpos-analytics-filters .mktpos-btn {
  grid-column: 1 / -1;
}
.mktpos-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.mktpos-analytics-kpi {
  background: linear-gradient(145deg, #0f172a, #1e293b);
  color: #fff;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}
.mktpos-analytics-kpi:nth-child(2) {
  background: linear-gradient(145deg, #184e77, #1d6f5f);
}
.mktpos-analytics-kpi:nth-child(3) {
  background: linear-gradient(145deg, #9a3412, #c2410c);
}
.mktpos-analytics-kpi:nth-child(4) {
  background: linear-gradient(145deg, #6b21a8, #9333ea);
}
.mktpos-analytics-kpi-label {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
  font-weight: 700;
}
.mktpos-analytics-kpi-value {
  font-size: 32px;
  line-height: 1.05;
}
.mktpos-analytics-kpi small {
  color: rgba(255,255,255,.8);
}
.mktpos-analytics-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.25fr);
  gap: 20px;
  margin-bottom: 20px;
}
.mktpos-analytics-panel {
  background: #fff;
  border: 1px solid var(--mktpos-border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
  margin-bottom: 20px;
}
.mktpos-analytics-panel h3 {
  margin: 0 0 16px;
  font-size: 18px;
}
.mktpos-analytics-payments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.mktpos-analytics-payment-item {
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border-left: 4px solid var(--mktpos-brand);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mktpos-analytics-payment-item span {
  color: var(--mktpos-text-muted);
  font-size: 13px;
}
.mktpos-analytics-payment-item strong {
  font-size: 22px;
}
.mktpos-analytics-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mktpos-analytics-bar-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mktpos-analytics-bar-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--mktpos-text-secondary);
}
.mktpos-analytics-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.mktpos-analytics-bar-track-secondary {
  height: 8px;
  background: #f1f5f9;
}
.mktpos-analytics-bar {
  height: 100%;
  border-radius: inherit;
}
.mktpos-analytics-bar-sale {
  background: linear-gradient(90deg, #fb923c, #f97316);
}
.mktpos-analytics-bar-paid {
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
}
.mktpos-analytics-table td:last-child {
  min-width: 240px;
}

/* ============================================================
 * REPORT REDESIGN — compact header + horizontal filter bar
 * ============================================================ */

/* Compact orange header */
.mktpos-rpt-header {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mktpos-rpt-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
}
.mktpos-rpt-subtitle {
  font-size: 13px;
  opacity: .85;
  white-space: nowrap;
}

/* Horizontal inline filter bar */
.mktpos-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 28px;
  background: #f8f8f8;
  border-bottom: 1px solid #eaeaea;
  flex-wrap: wrap;
}
.mktpos-fb-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mktpos-fb-field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #999;
}
.mktpos-fb-input {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #333;
  min-width: 0;
  width: auto;
}
.mktpos-fb-input:focus {
  outline: none;
  border-color: #ff6b35;
  box-shadow: 0 0 0 2px rgba(255,107,53,.15);
}
select.mktpos-fb-input {
  width: 110px;
  cursor: pointer;
}
.mktpos-fb-date {
  width: 142px;
}
.mktpos-fb-btn {
  height: 34px;
  padding: 0 18px;
  background: #ff6b35;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.mktpos-fb-btn:hover {
  background: #e85d2c;
}

/* Filter bar separator */
.mktpos-fb-sep {
  width: 1px;
  height: 28px;
  background: #ddd;
  align-self: flex-end;
  margin-bottom: 3px;
}

/* Section navigation bar */
.mktpos-section-nav {
  display: flex;
  gap: 4px;
  padding: 0 0 16px;
  margin-bottom: 20px;
  border-bottom: 2px solid #eaeaea;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}
.mktpos-snav-link {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #888 !important;
  text-decoration: none !important;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.mktpos-snav-link:hover {
  color: #333 !important;
  text-decoration: none !important;
  background: #f5f5f5;
}
.mktpos-snav-link.mktpos-snav-active {
  color: #ff6b35 !important;
  border-bottom-color: #ff6b35;
}

/* Tab panel system */
.mktpos-tab-panel {
  display: none;
}
.mktpos-tab-panel.mktpos-tab-active {
  display: block;
  animation: mktposFadeIn .2s ease;
}
@keyframes mktposFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Detail cards inside tab */
.mktpos-detail-cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 20px;
}

/* Ver más button */
.mktpos-btn-ver-mas {
  background: none;
  border: 1px solid #ddd;
  color: #ff6b35;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.mktpos-btn-ver-mas:hover {
  background: #fff5f0;
  border-color: #ff6b35;
}

/* Panel header with inline search */
.mktpos-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mktpos-panel-header h3 {
  margin: 0;
}

/* Legend for comparativo mensual */
.mktpos-analytics-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #666;
}
.mktpos-analytics-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.mktpos-legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.mktpos-legend-dot-sale {
  background: linear-gradient(90deg, #fb923c, #f97316);
}
.mktpos-legend-dot-paid {
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
}

/* Table scroll wrapper */
.mktpos-table-scroll {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}

.mktpos-analytics-content {
  padding: 24px 28px 28px;
}

/* KPI summary cards — orange accent */
.mktpos-analytics-summary-cards {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 24px;
}
.mktpos-analytics-summary-cards .mktpos-report-card {
  border-left: 5px solid #ff6b35;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
}
.mktpos-analytics-summary-cards .mktpos-report-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255,107,53,.15);
}
.mktpos-analytics-summary-cards .mktpos-report-method {
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.mktpos-analytics-summary-cards .mktpos-report-amount {
  color: #ff6b35;
  font-size: 28px;
}
.mktpos-analytics-summary-cards .mktpos-report-card small {
  color: #999;
  font-size: 12px;
}

/* Analytics panels — clean white with orange h3 */
.mktpos-analytics-panel h3 {
  color: #ff6b35;
  border-bottom: 2px solid #ff6b35;
  padding-bottom: 10px;
  font-size: 18px;
}

/* Payment items — orange left border */
.mktpos-analytics-payment-item {
  background: #fafafa;
  border-left-color: #ff6b35;
  border-radius: 8px;
}
.mktpos-analytics-payment-item strong {
  color: #ff6b35;
}

/* Bar chart — orange bars */
.mktpos-analytics-bar-sale {
  background: linear-gradient(90deg, #ff6b35, #f7931e);
}
.mktpos-analytics-bar-paid {
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
}

/* Weekly table — styled header */
.mktpos-analytics-table thead {
  background: #fafafa;
  border-bottom: 3px solid #ff6b35;
}
.mktpos-analytics-table th {
  color: #ff6b35;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 14px 16px;
}
.mktpos-analytics-table td {
  border-bottom-color: #eaeaea;
}
.mktpos-analytics-table tr:hover td {
  background: #fff5f0;
}
.mktpos-analytics-table tr.mktpos-month-total {
  background: #fafafa;
  font-weight: 700;
}
.mktpos-analytics-table tr.mktpos-month-total td {
  color: #ff6b35;
  border-top: 2px solid #ff6b35;
}
.mktpos-analytics-table tr.mktpos-grand-total {
  background: linear-gradient(90deg, #ff6b35, #f7931e);
  color: #fff;
  font-weight: 700;
}
.mktpos-analytics-table tr.mktpos-grand-total td {
  color: #fff;
  border-bottom-color: transparent;
}

/* Empty state */
.mktpos-analytics-shell .mktpos-empty-state {
  padding: 60px 28px;
  text-align: center;
}
.mktpos-analytics-shell .mktpos-empty-state h3 {
  color: #333;
  border: none;
  font-size: 22px;
}

/* Legend dots for chart */
.mktpos-legend-dot-sale {
  background: linear-gradient(90deg, #ff6b35, #f7931e) !important;
}

/* Section titles — orange */
.mktpos-page-reports .mktpos-section-title {
  border-bottom-color: #ff6b35;
  color: #333;
}

/* ============================================================
 * RESPONSIVE
 * ============================================================ */
@media (max-width: 1024px) {
  .mktpos-builder-grid {
    grid-template-columns: 1fr;
  }
  .mktpos-quote-grid {
    grid-template-columns: 1fr;
  }
  .mktpos-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mktpos-info-row {
    grid-template-columns: 1fr;
  }
  .mktpos-card-sticky {
    position: static;
  }
  .mktpos-analytics-grid {
    grid-template-columns: 1fr;
  }
  .mktpos-analytics-hero {
    flex-direction: column;
  }
  .mktpos-dashboard-hero-actions {
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* Navbar: stack brand + links, show hamburger */
  .mktpos-navbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px;
    border-radius: var(--mktpos-radius) var(--mktpos-radius) 0 0;
  }
  .mktpos-navbar-brand {
    flex: 1;
  }
  .mktpos-navbar-brand::after {
    display: none;
  }
  /* Nav links collapse by default on mobile */
  .mktpos-navbar-links {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0 4px;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .mktpos-navbar-links.mktpos-nav-open {
    display: flex;
  }
  .mktpos-nav-link {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 6px;
    width: 100%;
  }
  /* CTA label hidden on mobile to save space */
  .mktpos-nav-cta-label {
    display: none;
  }
  .mktpos-nav-cta {
    padding: 7px 11px;
    border-radius: 50%;
  }
  /* Hamburger visible */
  .mktpos-hamburger {
    display: flex;
  }
  .mktpos-navbar-actions {
    gap: 6px;
  }
  .mktpos-content {
    padding: 16px 12px 8px;
  }
  .mktpos-dashboard-hero {
    padding: 18px 16px 16px;
    border-radius: 22px;
  }
  .mktpos-dashboard-header,
  .mktpos-dashboard-header-main {
    margin-bottom: 12px;
  }
  .mktpos-dashboard-hero-actions {
    width: 100%;
  }
  .mktpos-dashboard-hero-actions .mktpos-btn {
    flex: 1 1 100%;
  }
  .mktpos-page-header h1 {
    font-size: 28px;
  }
  .mktpos-kpi-grid {
    grid-template-columns: 1fr;
  }
  .mktpos-field-half, .mktpos-field-third, .mktpos-field-twothirds {
    width: 100%;
  }
  .mktpos-search-bar .mktpos-input,
  .mktpos-inline-search .mktpos-input {
    width: 100%;
  }
  .mktpos-search-bar, .mktpos-inline-search {
    width: 100%;
  }
  .mktpos-date-range {
    width: 100%;
  }
  .mktpos-date-range .mktpos-input {
    width: 100%;
    flex: 1;
  }
  .mktpos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .mktpos-search-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .mktpos-report-cards {
    grid-template-columns: 1fr 1fr;
  }
  .mktpos-analytics-shell {
    padding: 18px;
  }
  .mktpos-analytics-filters {
    width: 100%;
    min-width: 0;
  }
  .mktpos-filter-bar {
    padding: 10px 16px;
    gap: 8px;
  }
  .mktpos-fb-field {
    flex: 1;
    min-width: 80px;
  }
  select.mktpos-fb-input,
  .mktpos-fb-date {
    width: 100%;
  }
  .mktpos-rpt-header {
    padding: 14px 16px;
    flex-wrap: wrap;
  }
  .mktpos-fb-sep {
    display: none;
  }
  .mktpos-section-nav {
    gap: 2px;
  }
  .mktpos-snav-link {
    padding: 6px 10px;
    font-size: 12px;
  }
  .mktpos-analytics-content {
    padding: 16px 16px 20px;
  }
  .mktpos-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .mktpos-panel-header .mktpos-table-search {
    max-width: 100% !important;
    width: 100%;
  }
  .mktpos-filters {
    width: 100%;
  }
  .mktpos-filter-select {
    width: 100%;
  }
  .mktpos-line-controls {
    flex-direction: column;
  }
  .mktpos-line-field {
    width: 100%;
  }
  .mktpos-note-form {
    flex-direction: column;
  }
  .mktpos-dash-table-wrap {
    padding: 0 12px 14px;
  }
  .mktpos-dash-table th,
  .mktpos-dash-table td {
    padding: 12px 12px;
  }
}

@media (max-width: 480px) {
  .mktpos-login-container {
    border-radius: 16px;
  }
  .mktpos-login-form {
    padding: 24px 20px;
  }
  .mktpos-report-cards {
    grid-template-columns: 1fr;
  }
  .mktpos-analytics-kpis {
    grid-template-columns: 1fr;
  }
  .mktpos-analytics-payments {
    grid-template-columns: 1fr;
  }
  .mktpos-fb-btn {
    width: 100%;
  }
}

/* ============================================================
 * STATE FILTER BUTTONS (Dashboard)
 * ============================================================ */
.mktpos-state-filters {
  display: flex;
  width: 100%;
  background: var(--mktpos-bg);
  border-radius: var(--mktpos-radius);
  overflow: hidden;
  border: 2px solid var(--mktpos-border);
  margin-bottom: 16px;
}
.mktpos-state-btn {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--mktpos-text-secondary);
  transition: all .25s ease;
  white-space: nowrap;
  position: relative;
}
.mktpos-state-btn:not(:last-child) {
  border-right: 1px solid var(--mktpos-border);
}
.mktpos-state-btn:hover {
  background: rgba(0,0,0,.04);
}
.mktpos-state-btn.active {
  color: #fff;
  font-weight: 700;
}
.mktpos-state-btn[data-state=""].active {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}
.mktpos-state-btn[data-state="draft"].active {
  background: linear-gradient(135deg, #6c757d, #868e96);
}
.mktpos-state-btn[data-state="advance"].active {
  background: linear-gradient(135deg, #e76f51, #f4a261);
}
.mktpos-state-btn[data-state="processing"].active {
  background: linear-gradient(135deg, #0077b6, #00b4d8);
}
.mktpos-state-btn[data-state="completed"].active {
  background: linear-gradient(135deg, #2d6a4f, #52b788);
}
.mktpos-state-btn[data-state="cancelled"].active {
  background: linear-gradient(135deg, #e63946, #ff6b6b);
}
.mktpos-state-count {
  display: inline-block;
  background: rgba(255,255,255,.25);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 4px;
}
.mktpos-state-btn:not(.active) .mktpos-state-count {
  background: rgba(0,0,0,.08);
}

/* ============================================================
 * DISCOUNT / SHIPPING FIELDS (Builder)
 * ============================================================ */
.mktpos-extra-fields {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  background: var(--mktpos-bg);
  border-top: 1px solid var(--mktpos-border);
  flex-wrap: wrap;
}
.mktpos-extra-field {
  flex: 1;
  min-width: 140px;
}
.mktpos-extra-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mktpos-text-secondary);
  margin-bottom: 4px;
}
.mktpos-extra-field .mktpos-input {
  width: 100%;
  font-size: 14px;
}
.mktpos-summary-breakdown {
  padding: 12px 20px;
  background: var(--mktpos-bg);
  border-top: 1px solid var(--mktpos-border);
}
.mktpos-summary-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}
.mktpos-summary-line.total {
  font-size: 18px;
  font-weight: 800;
  color: var(--mktpos-danger);
  padding-top: 8px;
  margin-top: 4px;
  border-top: 2px solid var(--mktpos-border);
}
.mktpos-summary-line span:first-child {
  color: var(--mktpos-text-secondary);
}
.mktpos-summary-line span:last-child {
  font-weight: 700;
}

/* Responsive state buttons */
@media (max-width: 768px) {
  .mktpos-state-filters {
    flex-wrap: wrap;
  }
  .mktpos-state-btn {
    flex: 1 1 33.33%;
    font-size: 12px;
    padding: 10px 6px;
  }
  .mktpos-state-btn:not(:last-child) {
    border-right: 1px solid var(--mktpos-border);
  }
  .mktpos-extra-fields {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .mktpos-state-btn {
    flex: 1 1 50%;
  }
}

/* ============================================================
 * AJAX AUTOCOMPLETE SEARCH
 * ============================================================ */
.mktpos-search-wrapper {
  position: relative;
}
.mktpos-ajax-search-container {
  position: relative;
  flex: 1;
}
.mktpos-ajax-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--mktpos-brand);
  border-top: none;
  border-radius: 0 0 var(--mktpos-radius-sm) var(--mktpos-radius-sm);
  box-shadow: var(--mktpos-shadow-lg);
  max-height: 350px;
  overflow-y: auto;
  z-index: 1000;
}
.mktpos-ajax-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--mktpos-border);
}
.mktpos-ajax-item:last-child { border-bottom: none; }
.mktpos-ajax-item:hover {
  background: var(--mktpos-brand-soft);
}
.mktpos-ajax-in-cart {
  background: var(--mktpos-success-bg) !important;
}
.mktpos-ajax-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.mktpos-ajax-no-img {
  background: #f0f0f5;
}
.mktpos-ajax-info {
  flex: 1;
  min-width: 0;
}
.mktpos-ajax-info strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mktpos-ajax-price {
  display: block;
  font-size: 12px;
  color: var(--mktpos-success);
  font-weight: 600;
}
.mktpos-ajax-info small {
  display: block;
  font-size: 11px;
  color: var(--mktpos-text-muted);
}
.mktpos-ajax-add {
  font-size: 12px;
  font-weight: 600;
  color: var(--mktpos-success);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--mktpos-success-bg);
  transition: all .15s;
}
.mktpos-ajax-add:hover {
  background: var(--mktpos-success);
  color: #fff;
}
.mktpos-ajax-added {
  font-size: 12px;
  font-weight: 600;
  color: var(--mktpos-text-muted);
  white-space: nowrap;
}
.mktpos-ajax-loading, .mktpos-ajax-empty {
  padding: 16px;
  text-align: center;
  color: var(--mktpos-text-muted);
  font-size: 13px;
}

/* ============================================================
 * DISCOUNT TYPE SELECTOR ($ / %)
 * ============================================================ */
.mktpos-discount-input-group {
  display: flex;
  gap: 4px;
  align-items: center;
}
.mktpos-discount-type-select {
  width: 52px !important;
  min-width: 52px;
  padding: 8px 4px !important;
  text-align: center;
  font-weight: 700;
  font-size: 14px !important;
  flex-shrink: 0;
}
.mktpos-discount-input-group .mktpos-input-sm {
  flex: 1;
}

/* Line-level discount type */
.mktpos-line-disc-group {
  display: flex;
  gap: 4px;
  align-items: center;
}
.mktpos-line-disc-group select.mktpos-input {
  width: 42px !important;
  min-width: 42px;
  padding: 6px 2px !important;
  text-align: center;
  font-weight: 700;
  font-size: 12px !important;
}
.mktpos-line-disc-group input.mktpos-input {
  flex: 1;
  min-width: 50px;
}
.mktpos-line-field-disc {
  min-width: 110px !important;
}

/* ============================================================
 * SHIPMENT TRACKING TABLE
 * ============================================================ */
.mktpos-shipment-items {
  padding: 0;
}
.mktpos-shipment-table {
  width: 100%;
  border-collapse: collapse;
}
.mktpos-shipment-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mktpos-text-muted);
  background: var(--mktpos-bg);
  border-bottom: 2px solid var(--mktpos-border);
}
.mktpos-shipment-table td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--mktpos-border);
  vertical-align: middle;
}
.mktpos-shipment-table tr:hover td {
  background: var(--mktpos-brand-soft);
}
.mktpos-shipment-actions {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--mktpos-border);
  flex-wrap: wrap;
}
.mktpos-input-xs {
  padding: 4px 6px !important;
  font-size: 12px !important;
  text-align: center;
}

/* ============================================================
 * SHIPPING EVIDENCE
 * ============================================================ */
.mktpos-evidence-section {
  padding: 16px 20px;
  border-top: 1px solid var(--mktpos-border);
}
.mktpos-evidence-section h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--mktpos-text);
}
.mktpos-evidence-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mktpos-evidence-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mktpos-evidence-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--mktpos-border);
  transition: transform .2s;
}
.mktpos-evidence-thumb:hover {
  transform: scale(1.1);
  border-color: var(--mktpos-brand);
}
.mktpos-evidence-item small {
  font-size: 10px;
  color: var(--mktpos-text-muted);
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mktpos-evidence-upload {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.mktpos-evidence-upload input[type="file"] {
  flex: 1;
  min-width: 200px;
}

/* ============================================================
 * ALERTS
 * ============================================================ */
.mktpos-alert {
  padding: 12px 16px;
  border-radius: var(--mktpos-radius-sm);
  font-size: 14px;
  font-weight: 500;
}
.mktpos-alert-error {
  background: var(--mktpos-danger-bg);
  color: var(--mktpos-danger);
  border: 1px solid rgba(230,57,70,.2);
}
.mktpos-alert-success {
  background: var(--mktpos-success-bg);
  color: var(--mktpos-success);
  border: 1px solid rgba(45,106,79,.2);
}
.mktpos-alert-warning {
  background: var(--mktpos-warning-bg);
  color: #e76f51;
  border: 1px solid rgba(244,162,97,.2);
}

/* ============================================================
 * EXTRA FIELDS REFINEMENT
 * ============================================================ */
.mktpos-extra-row {
  width: 100%;
  margin-bottom: 8px;
}
.mktpos-extra-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mktpos-text-secondary);
  margin-bottom: 4px;
}
.mktpos-input-sm {
  padding: 8px 10px !important;
  font-size: 13px !important;
}

/* Instalación field – clases -01 para integración con PDF */
.mktpos-extra-row-01 {
  width: 100%;
  margin-bottom: 8px;
}
.mktpos-extra-row-01 label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mktpos-text-secondary);
  margin-bottom: 4px;
}
.mktpos-input-01 {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--mktpos-border);
  border-radius: var(--mktpos-radius-sm);
  font-size: 14px;
  color: var(--mktpos-text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.mktpos-input-01:focus {
  outline: none;
  border-color: var(--mktpos-brand);
  box-shadow: 0 0 0 3px var(--mktpos-brand-weak);
}
.mktpos-input-sm-01 {
  padding: 8px 10px !important;
  font-size: 13px !important;
}

.mktpos-summary-final {
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px dashed var(--mktpos-border);
}
.mktpos-final-total {
  font-size: 16px !important;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 2px solid var(--mktpos-border);
}
.mktpos-final-total strong {
  color: var(--mktpos-danger) !important;
  font-size: 18px;
}

/* ============================================================
 * DASHBOARD DATE FILTERS
 * ============================================================ */
.mktpos-filters #mktpos_filter_date_from,
.mktpos-filters #mktpos_filter_date_to {
  width: 150px;
}
.mktpos-filters #mktpos_filter_search {
  width: 200px;
}

/* ============================================================
 * COMPLETE NOTE
 * ============================================================ */
.mktpos-complete-note {
  font-size: 12px;
  color: var(--mktpos-text-muted);
  margin: 4px 0 0;
  text-align: center;
}

/* ============================================================
 * FULFILLMENT BADGE ADDITIONS
 * ============================================================ */
.mktpos-badge-shipped { background: #0077b620; color: #0077b6; border: 1px solid #0077b640; }
.mktpos-badge-delivered { background: #2d6a4f20; color: #2d6a4f; border: 1px solid #2d6a4f40; }

/* ============================================================
 * RESPONSIVE ADDITIONS
 * ============================================================ */
@media (max-width: 768px) {
  .mktpos-ajax-results {
    max-height: 250px;
  }
  .mktpos-shipment-table {
    font-size: 12px;
  }
  .mktpos-shipment-table th,
  .mktpos-shipment-table td {
    padding: 8px 8px;
  }
  .mktpos-evidence-list {
    justify-content: center;
  }
  .mktpos-filters #mktpos_filter_date_from,
  .mktpos-filters #mktpos_filter_date_to,
  .mktpos-filters #mktpos_filter_search {
    width: 100%;
  }
  .mktpos-discount-input-group {
    flex-wrap: nowrap;
  }
}


/* ============================================================
 * STOCK VALIDATION STYLES
 * ============================================================ */
.mktpos-stock-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.mktpos-stock-badge.mktpos-stock-out {
  background: var(--mktpos-danger-bg);
  color: var(--mktpos-danger);
}
.mktpos-stock-badge.mktpos-stock-ok {
  background: var(--mktpos-success-bg);
  color: var(--mktpos-success);
}

/* Ajax dropdown: out of stock items */
.mktpos-ajax-item.mktpos-ajax-no-stock {
  opacity: 0.6;
  cursor: not-allowed;
  background: #fde8ea;
}
.mktpos-ajax-item.mktpos-ajax-no-stock:hover {
  background: #fde8ea;
}
.mktpos-ajax-nostock-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mktpos-danger);
  white-space: nowrap;
  padding: 4px 8px;
  background: var(--mktpos-danger-bg);
  border-radius: 6px;
}

/* Catalog grid: out of stock items */
.mktpos-search-item.mktpos-no-stock-item {
  opacity: 0.55;
  cursor: not-allowed;
  position: relative;
}
.mktpos-search-item.mktpos-no-stock-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.3);
  border-radius: var(--mktpos-radius);
  pointer-events: none;
}
.mktpos-nostock-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mktpos-danger);
  text-align: center;
  display: block;
  padding: 4px 8px;
  background: var(--mktpos-danger-bg);
  border-radius: 6px;
}

/* Cart line items: stock warnings */
.mktpos-line-stock-warn {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}
.mktpos-line-stock-error {
  color: var(--mktpos-danger);
  background: var(--mktpos-danger-bg);
}
.mktpos-line-stock-ok {
  color: var(--mktpos-success);
  background: var(--mktpos-success-bg);
}
.mktpos-line-item.mktpos-line-no-stock {
  border-left: 3px solid var(--mktpos-danger);
  background: #fde8ea;
}
.mktpos-line-item.mktpos-line-stock-exceeded {
  border-left: 3px solid var(--mktpos-warning);
  background: #fff3e0;
}

/* ============================================================
 * EVIDENCE UPLOAD IMPROVEMENTS
 * ============================================================ */
.mktpos-evidence-new {
  animation: mktpos-fadeIn 0.5s ease-in-out;
}
@keyframes mktpos-fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}
.mktpos-evidence-upload {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--mktpos-border);
}

/* ============================================================
 * TOAST NOTIFICATION (added via JS)
 * ============================================================ */
#mktpos_toast {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}


/* ============================================================
 * CUSTOMER SEARCH DROPDOWN
 * ============================================================ */
.mktpos-customer-search-wrap {
  position: relative;
}
.mktpos-customer-results {
  z-index: 1000;
}
.mktpos-customer-item {
  cursor: pointer;
}
.mktpos-customer-item:hover {
  background: var(--mktpos-brand-soft);
}

/* ============================================================
 * EMAIL STATUS INDICATOR
 * ============================================================ */
.mktpos-email-status {
  display: block;
  margin-top: 4px;
  min-height: 18px;
}
.mktpos-email-exists-link {
  cursor: pointer;
  transition: opacity .2s;
}
.mktpos-email-exists-link:hover {
  opacity: .8;
  text-decoration: underline;
}

/* ============================================================
 * TOGGLE EXTRA FIELDS BUTTON
 * ============================================================ */
.mktpos-toggle-extra-fields {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mktpos-brand);
  border: 1px dashed var(--mktpos-brand-border);
  background: var(--mktpos-brand-soft);
  padding: 8px 16px;
  border-radius: var(--mktpos-radius-sm);
  cursor: pointer;
  transition: all .2s;
  width: 100%;
  justify-content: center;
}
.mktpos-toggle-extra-fields:hover {
  background: var(--mktpos-brand-weak);
  border-color: var(--mktpos-brand);
}
.mktpos-toggle-icon {
  font-size: 10px;
  transition: transform .2s;
}
.mktpos-extra-address-fields {
  border: 1px solid var(--mktpos-border);
  border-radius: var(--mktpos-radius-sm);
  padding: 16px;
  background: var(--mktpos-brand-soft);
  margin-top: 8px;
}

/* ============================================================
 * Dashboard: columnas ocultas (Marca y Total)
 * Para mostrarlas de nuevo, comenta o elimina estas reglas
 * ============================================================ */
.mktpos-col-marca,
.mktpos-col-total {
  display: none;
}

/* ============================================================
 * ODOO-STYLE INLINE TABLE BUILDER (v2)
 * ============================================================ */

/* Client card — compact collapsible */
.mktpos-qb-client-card { margin-bottom: 12px; }
.mktpos-qb-client-header {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; user-select: none;
}
.mktpos-qb-client-preview { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mktpos-btn-icon {
  background: none; border: none; font-size: 12px; color: #888; cursor: pointer; padding: 4px 8px; line-height: 1;
  transition: transform .2s ease;
}
.mktpos-qb-client-body { padding: 0 16px 16px; }

/* Products card */
.mktpos-qb-products-card { margin-bottom: 12px; }
.mktpos-qb-products-header {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-bottom: 1px solid #eee;
}
.mktpos-qb-shortcut-hint { font-size: 11px; color: #999; }
.mktpos-qb-shortcut-hint kbd {
  background: #f0f0f5; border: 1px solid #ddd; border-radius: 3px; padding: 1px 5px;
  font-size: 10px; font-family: inherit; color: #555;
}

/* Table */
.mktpos-qb-table-wrap { overflow-x: auto; overflow-y: visible; }
.mktpos-qb-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.mktpos-qb-table thead th {
  background: #f8f9fa; padding: 8px 10px; text-align: left; font-weight: 600;
  font-size: 11px; text-transform: uppercase; color: #666; letter-spacing: .3px;
  border-bottom: 2px solid #eee; white-space: nowrap;
}
.mktpos-qb-table tbody tr { border-bottom: 1px solid #f0f0f0; }
.mktpos-qb-table tbody tr:hover { background: #fafbfc; }
.mktpos-qb-table tbody td { padding: 6px 10px; vertical-align: middle; }

/* Column widths */
.mktpos-qb-col-num { width: 36px; text-align: center; color: #aaa; font-size: 12px; }
.mktpos-qb-col-product { min-width: 180px; }
.mktpos-qb-col-sku { width: 90px; color: #888; font-size: 12px; }
.mktpos-qb-col-stock { width: 70px; font-size: 12px; }
.mktpos-qb-col-qty { width: 72px; }
.mktpos-qb-col-price { width: 100px; text-align: right; }
.mktpos-qb-col-disc { width: 140px; }
.mktpos-qb-col-subtotal { width: 100px; text-align: right; font-weight: 600; }
.mktpos-qb-col-note { min-width: 130px; }
.mktpos-qb-col-actions { width: 40px; text-align: center; }

/* Discount group inside table cell */
.mktpos-qb-disc-group { display: flex; gap: 4px; align-items: center; }
.mktpos-qb-disc-group .mktpos-qb-disc-type { width: 44px !important; padding: 4px 2px !important; font-size: 12px !important; flex-shrink: 0; }
.mktpos-qb-disc-group .mktpos-qb-disc-val  { width: 72px !important; padding: 4px 6px !important; font-size: 12px !important; }

/* Note input inside table */
.mktpos-qb-note-input { width: 100% !important; padding: 4px 6px !important; font-size: 12px !important; }

/* Merge preview box */
.mktpos-merge-preview-box { background: #f0f4ff; border: 1px solid #c0cfe8; border-radius: 8px; padding: 12px 16px; font-size: 13px; line-height: 1.6; }

/* Inputs inside table */
.mktpos-qb-product-input {
  width: 100%; padding: 6px 10px !important; font-size: 13px !important;
  border: 1px solid #e0e0e0 !important; border-radius: 6px !important;
}
.mktpos-qb-product-input:focus {
  border-color: #ff6b35 !important; box-shadow: 0 0 0 2px rgba(255,107,53,.15) !important;
  outline: none;
}
.mktpos-qb-qty-input {
  width: 64px; padding: 5px 8px !important; text-align: center; font-size: 13px !important;
  border: 1px solid #e0e0e0 !important; border-radius: 6px !important;
}
.mktpos-qb-qty-input:focus {
  border-color: #ff6b35 !important; box-shadow: 0 0 0 2px rgba(255,107,53,.15) !important;
  outline: none;
}
.mktpos-qb-qty-input:disabled { background: #f5f5f5; color: #ccc; cursor: not-allowed; }

/* Product name in filled row */
.mktpos-qb-prod-name {
  display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 280px;
}

/* Stock badges */
.mktpos-qb-stock-bad { color: #e63946; font-weight: 600; }

/* Remove button */
.mktpos-qb-remove {
  background: none; border: none; color: #ccc; font-size: 18px; cursor: pointer; padding: 2px 6px;
  line-height: 1; border-radius: 4px; transition: all .15s ease;
}
.mktpos-qb-remove:hover { color: #e63946; background: #fef2f2; }

/* Add row */
.mktpos-qb-add-row { padding: 8px 16px; border-top: 1px solid #f0f0f0; }

/* ---- Dropdown (autocomplete) ---- */
/* ============================================================
 * PRODUCT SEARCH — Floating panel (fixed viewport, never clipped)
 * ============================================================ */
.mktpos-qb-search-cell { position: relative; }
.mktpos-qb-product-input {
  width: 100%; padding: 7px 10px !important; font-size: 13px !important;
  border: 1.5px solid #e0e0e8 !important; border-radius: 6px !important;
  background: #fafafa !important; transition: border-color .15s, background .15s;
}
.mktpos-qb-product-input:focus {
  border-color: #017e84 !important; background: #fff !important;
  outline: none !important; box-shadow: 0 0 0 3px rgba(1,126,132,.1) !important;
}

/* Floating panel — uses JS to set top/left via getBoundingClientRect */
.mktpos-qb-dropdown {
  position: fixed;
  z-index: 99999;
  background: #fff;
  border: 1px solid #e0e0e8;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
  width: 400px;
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Loading / empty states */
.mktpos-qb-dd-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 20px 14px; color: #888; font-size: 13px;
}
.mktpos-qb-dd-loading::before {
  content: ''; width: 14px; height: 14px; border: 2px solid #ddd;
  border-top-color: #017e84; border-radius: 50%; animation: mktpos-spin .7s linear infinite;
}
@keyframes mktpos-spin { to { transform: rotate(360deg); } }
.mktpos-qb-dd-empty { padding: 20px 14px; color: #bbb; font-size: 13px; text-align: center; }

/* Product result item */
.mktpos-qb-dd-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f3f3f7;
  transition: background .1s;
}
.mktpos-qb-dd-item:last-child { border-bottom: none; }
.mktpos-qb-dd-item:hover,
.mktpos-qb-dd-highlight { background: #f0fafa; }
.mktpos-qb-dd-item.mktpos-qb-dd-in-cart { background: #f9fafb; opacity: .7; cursor: default; }
.mktpos-qb-dd-item.mktpos-qb-dd-no-stock { opacity: .45; cursor: not-allowed; }

/* Thumbnail */
.mktpos-qb-dd-thumb {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 6px; border: 1px solid #eee; flex-shrink: 0;
}
.mktpos-qb-dd-thumb-placeholder {
  width: 44px; height: 44px; border-radius: 6px; background: #f0f0f5;
  border: 1px solid #eee; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 18px; color: #ccc;
}

/* Name + meta */
.mktpos-qb-dd-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mktpos-qb-dd-name {
  font-weight: 600; font-size: 13px; color: #1a1a2e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mktpos-qb-dd-sku { font-size: 11px; color: #aaa; }
.mktpos-qb-dd-stock-ok  { font-size: 11px; color: #2d6a4f; font-weight: 500; }
.mktpos-qb-dd-stock-low { font-size: 11px; color: #f4a261; font-weight: 500; }
.mktpos-qb-dd-stock-out { font-size: 11px; color: #e63946; font-weight: 500; }

/* Price + badge (right side) */
.mktpos-qb-dd-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.mktpos-qb-dd-price { font-size: 14px; font-weight: 700; color: #017e84; white-space: nowrap; }
.mktpos-qb-dd-tag {
  font-size: 10px; background: #dcfce7; color: #166534;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap; font-weight: 600;
}
.mktpos-qb-dd-tag-cart {
  font-size: 10px; background: #e0e7ff; color: #4338ca;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap;
}

/* Header inside dropdown (result count) */
.mktpos-qb-dd-header {
  padding: 8px 14px 6px;
  font-size: 11px; color: #aaa; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; border-bottom: 1px solid #f3f3f7;
  position: sticky; top: 0; background: #fff; z-index: 1;
}

/* ---- Totals card ---- */
.mktpos-qb-totals-card { position: sticky; bottom: 0; z-index: 50; border-top: 2px solid #ff6b35; }
.mktpos-qb-totals-grid {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; padding: 16px; align-items: start;
}
.mktpos-qb-totals-left { display: flex; flex-direction: column; gap: 8px; }
.mktpos-qb-totals-row { display: flex; align-items: center; gap: 8px; }
.mktpos-qb-totals-row label { font-size: 12px; color: #666; min-width: 110px; }
.mktpos-qb-totals-right { display: flex; flex-direction: column; gap: 4px; text-align: right; }
.mktpos-qb-summary-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.mktpos-qb-summary-line span { color: #666; }
.mktpos-qb-summary-line strong { min-width: 90px; text-align: right; }
.mktpos-qb-final-total { font-size: 16px; border-top: 2px solid #333; padding-top: 6px; margin-top: 4px; }
.mktpos-qb-final-total span, .mktpos-qb-final-total strong { color: #111; }
.mktpos-qb-totals-action { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 180px; }

/* Mobile responsive */
@media (max-width: 768px) {
  .mktpos-qb-totals-grid { grid-template-columns: 1fr; }
  .mktpos-qb-col-sku, .mktpos-qb-col-stock, .mktpos-qb-col-note { display: none; }
  .mktpos-qb-products-header { flex-direction: column; gap: 6px; }
  .mktpos-qb-shortcut-hint { display: none; }
  .mktpos-qb-prod-name { max-width: 160px; }
}

/* ============================================================
 * ODOO-STYLE LAYOUT (New builder)
 * ============================================================ */

/* Page wrapper */
.mktpos-odoo-layout .mktpos-odoo-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 88px;
}

/* ---- Header ---- */
.mktpos-odoo-header {
  background: #fff;
  border-bottom: 1px solid #e8e8ed;
  padding: 28px 24px 22px;
  margin-bottom: 0;
}

.mktpos-odoo-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.mktpos-odoo-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  line-height: 1;
}

.mktpos-odoo-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* Top fields: two-column row */
.mktpos-odoo-fields-top {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin-bottom: 12px;
}

.mktpos-odoo-field-group { display: flex; flex-direction: column; gap: 4px; }
.mktpos-odoo-field-wide  { grid-column: span 2; }

.mktpos-odoo-label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  min-width: 80px;
}

.mktpos-odoo-input {
  border: 1px solid #d0d7de !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  background: #fff !important;
  transition: border-color .15s;
}
.mktpos-odoo-input:focus { border-color: #017e84 !important; outline: none !important; box-shadow: 0 0 0 3px rgba(1,126,132,.1) !important; }

.mktpos-odoo-input-sm {
  border: 1px solid #d0d7de !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  background: #fff !important;
}
.mktpos-odoo-input-sm:focus { border-color: #017e84 !important; outline: none !important; }

/* Right column rows */
.mktpos-odoo-field-right { gap: 8px; }
.mktpos-odoo-right-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mktpos-odoo-right-row .mktpos-odoo-label { min-width: 70px; }
.mktpos-odoo-right-row .mktpos-odoo-input-sm { flex: 1; }

/* Optional fields toggle */
.mktpos-odoo-optional-toggle { margin: 8px 0 4px; }
.mktpos-odoo-toggle-btn {
  background: none;
  border: none;
  color: #017e84;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.mktpos-odoo-toggle-btn:hover { text-decoration: underline; }

/* Extra fields grid */
.mktpos-odoo-extra-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 0 6px;
}

/* Mode row */
.mktpos-odoo-mode-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f5;
}

/* ---- Table section ---- */
.mktpos-odoo-table-section {
  background: #fff;
  border: 1px solid #e8e8ed;
  border-radius: 10px;
  margin-top: 16px;
  overflow: visible; /* Allow dropdown to show above table rows */
}

.mktpos-odoo-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid #e8e8ed;
  padding: 0 24px;
  justify-content: space-between;
}

.mktpos-odoo-tab {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  cursor: default;
}
.mktpos-odoo-tab-active {
  color: #017e84;
  border-bottom-color: #017e84;
}

.mktpos-odoo-tab-hint {
  font-size: 11px;
  color: #aaa;
}
.mktpos-odoo-tab-hint kbd {
  background: #f0f0f5;
  border: 1px solid #d0d7de;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
  color: #555;
}

/* Odoo-style table */
.mktpos-odoo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mktpos-odoo-table thead th {
  background: #f8f9fb;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #888;
  padding: 8px 10px;
  border-bottom: 1px solid #e8e8ed;
  white-space: nowrap;
}
.mktpos-odoo-table tbody tr { border-bottom: 1px solid #f0f0f5; }
.mktpos-odoo-table tbody tr:last-child { border-bottom: none; }
.mktpos-odoo-table tbody td { padding: 6px 10px; vertical-align: middle; }
.mktpos-odoo-table .mktpos-input { padding: 4px 8px !important; font-size: 13px !important; border-radius: 5px !important; }
/* Align the table's outer edges with the card frame (24px) */
.mktpos-odoo-table thead th:first-child,
.mktpos-odoo-table tbody td:first-child { padding-left: 24px; }
.mktpos-odoo-table thead th:last-child,
.mktpos-odoo-table tbody td:last-child { padding-right: 24px; }

/* Odoo layout column widths */
.mktpos-odoo-layout .mktpos-qb-col-product  { min-width: 200px; }
.mktpos-odoo-layout .mktpos-qb-col-note     { min-width: 160px; }
.mktpos-odoo-layout .mktpos-qb-col-qty      { width: 80px; text-align: right; }
.mktpos-odoo-layout .mktpos-qb-col-price    { width: 110px; text-align: right; }
.mktpos-odoo-layout .mktpos-qb-col-disc     { width: 130px; }
.mktpos-odoo-layout .mktpos-qb-col-subtotal { width: 110px; text-align: right; font-weight: 600; }
.mktpos-odoo-layout .mktpos-qb-col-actions  { width: 36px; text-align: center; }

/* SKU tag in product cell */
.mktpos-sku-tag { color: #888; font-size: 11px; margin-right: 4px; }

/* Admin brand selector in builder */
.mktpos-odoo-brand-select {
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
  border: 2px solid #017e84 !important;
  background: #f0fafa !important;
  color: #017e84 !important;
  cursor: pointer;
  min-width: 140px;
}
.mktpos-odoo-brand-select:focus { outline: none !important; box-shadow: 0 0 0 3px rgba(1,126,132,.15) !important; }

/* Editable product name */
.mktpos-qb-prod-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mktpos-qb-prod-editable {
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s, color .15s;
  display: inline-block;
  padding: 1px 0;
}
.mktpos-qb-prod-editable:hover {
  color: #017e84;
  border-bottom-color: #017e84;
}
.mktpos-qb-prod-editable:hover::after {
  content: ' ✎';
  font-size: 11px;
  color: #017e84;
  opacity: .7;
}
.mktpos-qb-inline-search { position: relative; }
.mktpos-qb-replace-input { width: 100% !important; font-size: 13px !important; }

/* Stock warning inline badge */
.mktpos-qb-stock-inline { color: #f0a500; font-size: 13px; margin-right: 2px; cursor: help; }

/* Note row (free-text) */
.mktpos-qb-row-note td { background: #fffdf0; }
.mktpos-qb-note-free-input { font-style: italic; color: #555 !important; background: transparent !important; border: 1px dashed #ddd !important; }

/* Odoo add links */
.mktpos-odoo-add-links {
  display: flex;
  gap: 20px;
  padding: 12px 24px;
  border-top: 1px solid #f0f0f5;
}
.mktpos-odoo-add-link {
  background: none;
  border: none;
  color: #017e84;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.mktpos-odoo-add-link:hover { text-decoration: underline; }

/* Terms input */
.mktpos-odoo-terms {
  padding: 14px 24px;
  border-top: 1px solid #f0f0f5;
}
.mktpos-odoo-terms-input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  color: #888;
  font-size: 13px !important;
  resize: none;
  padding: 4px 0 !important;
}
.mktpos-odoo-terms-input:focus { outline: none !important; box-shadow: none !important; border-bottom: 1px solid #d0d7de !important; }

/* Totals block (right-aligned) */
.mktpos-odoo-totals {
  display: flex;
  justify-content: flex-end;
  padding: 18px 24px;
  border-top: 1px solid #e8e8ed;
}
.mktpos-odoo-totals-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 320px;
}
.mktpos-odoo-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #333;
}
.mktpos-odoo-discount-row { color: #555; }
.mktpos-odoo-grand-total {
  font-size: 16px;
  font-weight: 700;
  border-top: 2px solid #e8e8ed;
  padding-top: 8px;
  margin-top: 4px;
  color: #1a1a2e;
}
.mktpos-odoo-disc-type-sel {
  width: 44px !important;
  padding: 2px 4px !important;
  font-size: 12px !important;
  margin-left: 8px;
}
.mktpos-odoo-disc-input {
  width: 80px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  text-align: right;
}

/* Save bar */
.mktpos-odoo-save-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid #e8e8ed;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.mktpos-odoo-save-meta { font-size: 13px; color: #888; display: flex; align-items: center; gap: 16px; }
.mktpos-odoo-save-actions { display: flex; align-items: center; gap: 12px; }
.mktpos-odoo-cancel-link {
  font-size: 13px;
  color: #888;
  text-decoration: none;
  border-bottom: 1px dashed #bbb;
  transition: color .15s;
}
.mktpos-odoo-cancel-link:hover { color: #e63946; border-bottom-color: #e63946; }

/* Odoo mobile responsive */
@media (max-width: 768px) {
  .mktpos-odoo-fields-top { grid-template-columns: 1fr; }
  .mktpos-odoo-extra-grid { grid-template-columns: 1fr 1fr; }
  .mktpos-odoo-layout .mktpos-qb-col-note { display: none; }
  .mktpos-odoo-totals-inner { min-width: unset; width: 100%; }
  .mktpos-odoo-totals { padding: 12px; }
}

/* ============================================================
 * OVERPAY MODAL OPTIONS
 * ============================================================ */
.mktpos-overpay-options { display: flex; flex-direction: column; gap: 8px; }
.mktpos-overpay-opt {
  display: block; width: 100%; text-align: left;
  padding: 12px 16px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: #1a1a2e;
  background: #f8f9fb; border: 1.5px solid #e8e8ed;
  transition: background .15s, border-color .15s, color .15s;
}
.mktpos-overpay-opt:hover { background: #f0fafa; border-color: #017e84; color: #017e84; }
.mktpos-overpay-force { background: #f0fdf4 !important; border-color: #86efac !important; color: #166534 !important; }
.mktpos-overpay-force:hover { background: #dcfce7 !important; color: #14532d !important; }

/* ============================================================
 * INVENTORY SECTION — [mktpos_inventory]
 * ============================================================ */

/* ── Wrap ── */
.mktpos-inventory-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Header ── */
.mktpos-inv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.mktpos-inv-header-left { display: flex; align-items: center; gap: 12px; }
.mktpos-inv-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mktpos-inv-icon { font-size: 22px; }
.mktpos-inv-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff4e5;
  color: #b45309;
  border: 1.5px solid #fcd34d;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.mktpos-inv-brand-badge {
  display: inline-block;
  background: #e8f4fb;
  color: #017e84;
  border: 1.5px solid #b3dce3;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* ── Toolbar ── */
.mktpos-inv-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.mktpos-inv-search {
  flex: 1 1 220px;
  max-width: 320px;
  padding: 8px 14px;
  border: 1.5px solid #dde;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.mktpos-inv-search:focus { border-color: #017e84; }
.mktpos-inv-check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  user-select: none;
}

/* ── Table ── */
.mktpos-inv-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1.5px solid #e8e8ed;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.mktpos-inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.mktpos-inv-table thead th {
  background: #f7f8fc;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  color: #444;
  border-bottom: 1.5px solid #e8e8ed;
  white-space: nowrap;
}
.mktpos-inv-table th.mktpos-inv-num,
.mktpos-inv-table td.mktpos-inv-num { text-align: right; }
.mktpos-inv-table th.mktpos-inv-status,
.mktpos-inv-table td.mktpos-inv-status { text-align: center; }
.mktpos-inv-table th.mktpos-inv-actions,
.mktpos-inv-table td.mktpos-inv-actions { text-align: center; }
.mktpos-inv-table th.mktpos-inv-moves,
.mktpos-inv-table td.mktpos-inv-moves { text-align: center; }

.mktpos-inv-row { border-bottom: 1px solid #f2f2f5; transition: background .1s; }
.mktpos-inv-row:last-child { border-bottom: none; }
.mktpos-inv-row:hover { background: #f8fafc; }
.mktpos-inv-table td { padding: 10px 14px; color: #1a1a2e; vertical-align: middle; }

.mktpos-inv-sku { font-family: monospace; font-size: 13px; color: #666; }
.mktpos-inv-name { font-weight: 500; }
.mktpos-inv-loading { text-align: center; padding: 32px; color: #888; }

/* ── Stock badges ── */
.mktpos-inv-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.mktpos-inv-badge-ok  { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.mktpos-inv-badge-low { background: #fff4e5; color: #b45309; border: 1px solid #fcd34d; }
.mktpos-inv-badge-out { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Pagination ── */
.mktpos-inv-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.mktpos-inv-pginfo { font-size: 13px; color: #888; }

/* ── Movements slide panel ── */
.mktpos-inv-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1200;
}
.mktpos-inv-moves-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 680px;
  max-width: 96vw;
  background: #fff;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
}
.mktpos-inv-moves-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1.5px solid #eee;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  background: #f7f8fc;
}
.mktpos-inv-moves-close {
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: #888; padding: 4px 8px;
  border-radius: 6px; transition: background .15s;
}
.mktpos-inv-moves-close:hover { background: #f2f2f5; color: #333; }
.mktpos-inv-moves-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.mktpos-inv-moves-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mktpos-inv-moves-table thead th {
  background: #f7f8fc;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 1.5px solid #e8e8ed;
  white-space: nowrap;
}
.mktpos-inv-moves-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f2f2f5;
  color: #1a1a2e;
  vertical-align: middle;
}
.mktpos-inv-moves-date { white-space: nowrap; color: #888; font-size: 12px; }
.mktpos-inv-move-type { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.mktpos-inv-pos { color: #166534; font-weight: 700; }
.mktpos-inv-neg { color: #991b1b; font-weight: 700; }

/* ── Adjust modal ── */
#mktpos-inv-adj-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.40);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#mktpos-inv-adj-modal {
  background: #fff;
  border-radius: 14px;
  width: 440px;
  max-width: 94vw;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── select pill (brand filter dropdown) ── */
.mktpos-select-pill {
  padding: 6px 14px;
  border: 1.5px solid #b3dce3;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #017e84;
  background: #e8f4fb;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.mktpos-select-pill:focus { border-color: #017e84; }

/* ── responsive ── */
@media (max-width: 600px) {
  .mktpos-inv-moves-panel { width: 100%; }
  .mktpos-inv-table th.mktpos-inv-num,
  .mktpos-inv-table td.mktpos-inv-num { display: none; }
}

/* ============================================================
 * NEW UX/UI IMPROVEMENTS — 2026
 * ============================================================ */

/* ── Dashboard: Period Tabs ── */
.mktpos-period-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  padding: 4px;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(31,41,55,.08);
  border-radius: 16px;
  width: fit-content;
  box-shadow: 0 10px 24px rgba(44,28,18,.06);
}
.mktpos-period-tab {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #6b7280;
  transition: background .15s, color .15s;
}
.mktpos-period-tab.active,
.mktpos-period-tab:hover {
  background: #fff;
  color: #111827;
  box-shadow: 0 8px 18px rgba(44,28,18,.08);
}
.mktpos-kpi-loading-spinner { display: flex; align-items: center; margin-left: 8px; opacity: .6; }
.mktpos-spin { animation: mktpos-spin .7s linear infinite; }
@keyframes mktpos-spin { to { transform: rotate(360deg); } }

/* ── Dashboard: Alert Panel ── */
.mktpos-alert-panel {
  background: #fff;
  border: 1px solid #fde3c0;
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(217,119,6,.07);
}
.mktpos-alert-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: linear-gradient(180deg, #fff7ed, #fff1e0);
  border-bottom: 1px solid #fde3c0;
}
.mktpos-alert-panel-icon {
  color: #ea580c;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #ffedd5;
  border-radius: 9px;
  flex-shrink: 0;
}
.mktpos-alert-panel-title {
  font-weight: 700;
  font-size: 13px;
  color: #9a3412;
  flex: 1;
  letter-spacing: .01em;
}
.mktpos-alert-panel-count {
  background: #ea580c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(234,88,12,.28);
}

/* ── Carrusel horizontal de tarjetas (compacto, auto-deslizante) ── */
.mktpos-alert-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #fcd9b6 transparent;
  cursor: grab;  /* manita: indica que se puede arrastrar de izquierda a derecha */
}
.mktpos-alert-list.mktpos-grabbing { cursor: grabbing; scroll-snap-type: none; }
.mktpos-alert-list.mktpos-grabbing .mktpos-alert-card { cursor: grabbing; }
.mktpos-alert-list::-webkit-scrollbar { height: 6px; }
.mktpos-alert-list::-webkit-scrollbar-track { background: transparent; }
.mktpos-alert-list::-webkit-scrollbar-thumb { background: #fcd9b6; border-radius: 10px; }

.mktpos-alert-card {
  flex: 0 0 auto;
  width: 250px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 14px 12px 18px;
  border: 1px solid #fde2bf;
  border-radius: 14px;
  background: linear-gradient(158deg, #fffaf3, #fff2e0);
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.mktpos-alert-card::before {  /* acento lateral */
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #fb923c, #ea580c);
}
.mktpos-alert-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(234,88,12,.16);
  border-color: #fb923c;
}
.mktpos-alert-name {
  font-weight: 700;
  color: #1a1a2e;
  font-size: 13.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mktpos-alert-name small { color: #b08968 !important; font-weight: 500; }
.mktpos-alert-reason {
  font-size: 11px;
  color: #c2620c;
  line-height: 1.3;
  min-height: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mktpos-alert-balance-row {
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px dashed #fcdcbb;
}
.mktpos-alert-balance {
  font-weight: 800;
  color: #ea580c;
  font-size: 15px;
  white-space: nowrap;
}

/* Acciones: dos botones tipo píldora (icono + texto), mini y responsive. */
.mktpos-alert-actions { display: flex; align-items: stretch; gap: 7px; margin-top: 9px; }
.mktpos-alert-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.mktpos-alert-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.mktpos-alert-btn-view {
  background: #fff;
  color: #ea580c;
  border: 1.5px solid #fcd3a8;
}
.mktpos-alert-btn-view:hover { border-color: #ea580c; background: #fff7ed; transform: translateY(-1px); }
.mktpos-alert-btn-wa {
  background: #25D366;
  color: #fff;
  border: 1.5px solid #1da851;
  box-shadow: 0 3px 8px rgba(37,211,102,.3);
}
.mktpos-alert-btn-wa:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* Móvil: la tarjeta ocupa casi todo el ancho (1 visible, se desliza con el dedo). */
@media (max-width: 600px) {
  .mktpos-alert-card { width: 80vw; max-width: 320px; }
  .mktpos-alert-list { padding: 12px; }
}

/* ── Catalog: Layout ── */
.mktpos-catalog-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.mktpos-cat-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--mktpos-border, #e8e8ed);
  border-radius: 10px;
  padding: 12px 0;
  position: sticky;
  top: 80px;
}
.mktpos-cat-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 0 14px 8px;
  border-bottom: 1px solid #f0f0f5;
  margin-bottom: 4px;
}
.mktpos-cat-list { list-style: none; margin: 0; padding: 4px 0; }
.mktpos-cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 14px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  border-radius: 0;
  transition: background .12s, color .12s;
  cursor: pointer;
}
.mktpos-cat-item:hover { background: #f3f4f6; color: var(--mktpos-primary, #0077b6); }
.mktpos-cat-item.active { background: var(--mktpos-primary, #0077b6); color: #fff; font-weight: 600; }
.mktpos-cat-item.active .mktpos-cat-count { color: rgba(255,255,255,.8); }
.mktpos-cat-count { font-size: 11px; color: #9ca3af; font-weight: 600; }
.mktpos-catalog-main { flex: 1; min-width: 0; }

/* ── Catalog: Stock chips ── */
.mktpos-product-card { position: relative; }
.mktpos-stock-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: .03em;
  pointer-events: none;
}
.mktpos-chip-in  { background: #d1fae5; color: #065f46; }
.mktpos-chip-low { background: #fef3c7; color: #92400e; }
.mktpos-chip-out { background: #fee2e2; color: #991b1b; }

/* ── Quote View: Stepper ── */
.mktpos-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--mktpos-border, #e8e8ed);
  border-radius: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 0;
  position: relative;
}
.mktpos-stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 70px;
}
.mktpos-stepper-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2.5px solid #e5e7eb;
  background: #fff;
  color: #9ca3af;
  transition: all .2s;
}
.mktpos-stepper-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-align: center;
  white-space: nowrap;
}
.mktpos-stepper-line {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  margin-bottom: 14px;
  transition: background .2s;
}
.mktpos-stepper-line.done { background: var(--mktpos-primary, #0077b6); }
.mktpos-stepper-step.done .mktpos-stepper-dot {
  background: var(--mktpos-primary, #0077b6);
  border-color: var(--mktpos-primary, #0077b6);
  color: #fff;
}
.mktpos-stepper-step.done .mktpos-stepper-label { color: var(--mktpos-primary, #0077b6); }
.mktpos-stepper-step.active .mktpos-stepper-dot {
  background: #fff;
  border-color: var(--mktpos-primary, #0077b6);
  color: var(--mktpos-primary, #0077b6);
  box-shadow: 0 0 0 4px rgba(0,119,182,.12);
}
.mktpos-stepper-step.active .mktpos-stepper-label { color: var(--mktpos-primary, #0077b6); font-weight: 700; }
.mktpos-stepper-cancelled .mktpos-stepper-dot { border-color: #e5e7eb; background: #f3f4f6; color: #9ca3af; }
.mktpos-stepper-cancelled-badge {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: #fef2f2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #fecaca;
}

/* ── Quote View: More actions dropdown ── */
.mktpos-more-actions { position: relative; }
.mktpos-more-btn { display: flex; align-items: center; gap: 5px; }
.mktpos-more-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  opacity: 0;
  transform: translateY(-6px) scale(.97);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
  z-index: 300;
  padding: 4px 0;
}
.mktpos-more-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.mktpos-more-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background .1s;
}
.mktpos-more-item:hover { background: #f3f4f6; color: #111; }
.mktpos-more-divider { height: 1px; background: #f0f0f5; margin: 4px 0; }
.mktpos-btn-secondary {
  background: #f0f9ff;
  color: #0369a1;
  border: 1.5px solid #bae6fd;
  font-weight: 600;
}
.mktpos-btn-secondary:hover { background: #e0f2fe; }

/* ── Client cards ── */
.mktpos-cl-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.mktpos-cl-search-form {
  display: flex;
  gap: 10px;
  align-items: center;
}
.mktpos-cl-search-input { flex: 1; max-width: 420px; }
.mktpos-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.mktpos-filter-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all .15s;
}
.mktpos-filter-chip:hover { border-color: var(--mktpos-primary, #0077b6); color: var(--mktpos-primary, #0077b6); }
.mktpos-filter-chip.active {
  background: var(--mktpos-primary, #0077b6);
  border-color: var(--mktpos-primary, #0077b6);
  color: #fff;
}
.mktpos-filter-chip.active .mktpos-chip-badge { background: rgba(255,255,255,.3); }
.mktpos-chip-badge {
  background: #e5e7eb;
  color: #374151;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}
.mktpos-cl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.mktpos-cl-card {
  background: #fff;
  border: 1px solid var(--mktpos-border, #e8e8ed);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s, transform .15s;
}
.mktpos-cl-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-1px); }
.mktpos-cl-card[style*="display:none"] { display: none !important; }
.mktpos-cl-card-top { display: flex; gap: 12px; align-items: flex-start; }
.mktpos-cl-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mktpos-cl-card-info { flex: 1; min-width: 0; }
.mktpos-cl-name { font-size: 14px; font-weight: 700; color: #111; margin-bottom: 3px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.mktpos-cl-brand { font-size: 11px; font-weight: 600; color: var(--mktpos-brand, #4f46e5); letter-spacing: .3px; text-transform: uppercase; margin-bottom: 1px; }
.mktpos-cl-email { font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mktpos-cl-phone { font-size: 11px; color: #9ca3af; }
.mktpos-cl-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}
.mktpos-cl-badge-vip { background: #fef3c7; color: #92400e; }
.mktpos-cl-badge-balance { background: #fee2e2; color: #991b1b; }
.mktpos-cl-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mktpos-cl-metric {
  background: #f9fafb;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mktpos-cl-metric-warn { background: #fff7ed; }
.mktpos-cl-metric-val { font-size: 13px; font-weight: 700; color: #111; }
.mktpos-cl-metric-warn .mktpos-cl-metric-val { color: #d97706; }
.mktpos-cl-metric-lbl { font-size: 10px; color: #9ca3af; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mktpos-cl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mktpos-btn-whatsapp { background: #25d366; color: #fff; border-color: #25d366; }
.mktpos-btn-whatsapp:hover { background: #1ebe5d; }
.mktpos-cl-details { border-top: 1px solid #f3f4f6; padding-top: 8px; margin-top: 0; }
.mktpos-cl-details-toggle {
  font-size: 12px;
  color: var(--mktpos-primary, #0077b6);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  padding: 4px 0;
}
.mktpos-cl-details-toggle::-webkit-details-marker { display: none; }
.mktpos-cl-quotes-list { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.mktpos-cl-quote-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f9fafb;
  font-size: 12px;
  text-decoration: none;
  color: #374151;
  transition: background .1s;
}
.mktpos-cl-quote-row:hover { background: #f0f9ff; color: var(--mktpos-primary, #0077b6); }
.mktpos-cl-quote-id { font-weight: 700; color: var(--mktpos-primary, #0077b6); min-width: 36px; }

/* ── Inventory: Tabs ── */
.mktpos-inv-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 20px 0;
  border-bottom: 2px solid #f0f0f5;
  background: #fff;
}
.mktpos-inv-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.mktpos-inv-tab:hover { color: #111; }
.mktpos-inv-tab.active { color: var(--mktpos-primary, #0077b6); border-bottom-color: var(--mktpos-primary, #0077b6); background: transparent; }
.mktpos-inv-tab-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* ── Cortes: Date preset bar ── */
.mktpos-date-preset-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.mktpos-date-preset-label { font-size: 12px; font-weight: 700; color: #9ca3af; margin-right: 4px; }
.mktpos-date-preset {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  text-decoration: none;
  transition: all .15s;
}
.mktpos-date-preset:hover { border-color: var(--mktpos-primary, #0077b6); color: var(--mktpos-primary, #0077b6); }
.mktpos-date-preset.active {
  background: var(--mktpos-primary, #0077b6);
  border-color: var(--mktpos-primary, #0077b6);
  color: #fff;
}
.mktpos-date-preset-current {
  margin-left: auto;
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}
.mktpos-rpt-export-row { display: flex; gap: 8px; align-items: center; }
.mktpos-rpt-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }

/* ── Quote builder: Sticky footer ── */
.mktpos-sticky-footer {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  background: #fff;
  border-top: 2px solid var(--mktpos-border, #e8e8ed);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.07);
  z-index: 150;
  border-radius: 0 0 var(--mktpos-radius, 14px) var(--mktpos-radius, 14px);
  flex-wrap: wrap;
}
.mktpos-sticky-footer-meta { font-size: 13px; color: #6b7280; flex: 1; }
.mktpos-sticky-footer-total { display: flex; align-items: center; gap: 8px; }
.mktpos-sticky-total-label { font-size: 13px; color: #6b7280; font-weight: 600; }
.mktpos-sticky-total-val { font-size: 22px; font-weight: 800; color: #111; letter-spacing: -.02em; }
.mktpos-sticky-footer-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .mktpos-catalog-layout { flex-direction: column; }
  .mktpos-cat-sidebar { width: 100%; position: static; }
  .mktpos-cl-grid { grid-template-columns: 1fr; }
  .mktpos-stepper { gap: 4px; }
  .mktpos-stepper-label { font-size: 9px; }
  .mktpos-date-preset-bar { padding: 8px 12px; }
  .mktpos-date-preset-current { display: none; }
  .mktpos-sticky-footer { flex-direction: column; align-items: stretch; }
  .mktpos-sticky-footer-actions { justify-content: flex-end; }
  .mktpos-rpt-header { flex-direction: column; }
}

/* ── Brand context picker (navbar) ── */
.mktpos-brand-picker-wrap { position: relative; }
.mktpos-brand-picker-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  color: #fff;
  padding: 5px 10px 5px 12px;
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  transition: background .15s;
  white-space: nowrap;
}
.mktpos-brand-picker-btn:hover { background: rgba(255,255,255,.22); }
.mktpos-brand-picker-caret { opacity: .7; flex-shrink: 0; transition: transform .2s; }
.mktpos-brand-picker-btn[aria-expanded="true"] .mktpos-brand-picker-caret { transform: rotate(180deg); }
.mktpos-brand-picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  border: 1px solid #e8e8ed;
  z-index: 1200;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s, transform .18s;
}
.mktpos-brand-picker-dropdown.open {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.mktpos-brand-picker-option {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  font-size: 13px; color: #1a1a2e; cursor: pointer;
  transition: background .1s;
}
.mktpos-brand-picker-option:hover { background: #f5f5fa; }
.mktpos-brand-picker-option.active { font-weight: 600; background: #f0f7ff; color: var(--mktpos-primary, #ff6b35); }
.mktpos-brand-picker-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d0d0d8; flex-shrink: 0;
}
.mktpos-brand-picker-option.active .mktpos-brand-picker-dot { background: var(--mktpos-primary, #ff6b35); }

/* ============================================================
 * COMISIONES
 * ============================================================ */
.mktpos-page-commissions .mktpos-comm-content { max-width: 900px; margin: 0 auto; padding: 24px 16px; }

/* Header */
.mktpos-comm-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.mktpos-comm-title  { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.mktpos-comm-subtitle { color: var(--mktpos-text-muted, #6b7280); font-size: 14px; margin: 0; }

/* Tabs */
.mktpos-comm-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; margin-bottom: 24px; }
.mktpos-comm-tab  {
  background: none; border: none; padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--mktpos-text-muted, #6b7280); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s; border-radius: 6px 6px 0 0;
}
.mktpos-comm-tab:hover  { color: var(--mktpos-primary, #ff6b35); background: #fafafa; }
.mktpos-comm-tab.active { color: var(--mktpos-primary, #ff6b35); border-bottom-color: var(--mktpos-primary, #ff6b35); font-weight: 600; }

/* Seller list */
.mktpos-comm-seller-list { display: flex; flex-direction: column; gap: 12px; }
.mktpos-comm-seller-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  overflow: hidden; transition: box-shadow .15s;
}
.mktpos-comm-seller-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }

.mktpos-comm-seller-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer; user-select: none;
}
.mktpos-comm-seller-head:hover { background: #fafafa; }
.mktpos-comm-seller-info { display: flex; align-items: center; gap: 12px; }
.mktpos-comm-seller-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--mktpos-primary, #ff6b35);
  color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.mktpos-comm-rule-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; margin-left: 8px;
}
.mktpos-comm-rule-badge.configured { background: #dcfce7; color: #16a34a; }
.mktpos-comm-rule-badge.empty      { background: #f3f4f6; color: #9ca3af; }
.mktpos-comm-chevron { transition: transform .2s; flex-shrink: 0; color: #9ca3af; }
.mktpos-comm-chevron.open { transform: rotate(180deg); }

/* Rule editor */
.mktpos-comm-rule-editor { padding: 0 20px 20px; border-top: 1px solid #f0f0f5; }
.mktpos-comm-section { margin-top: 18px; }
.mktpos-comm-label  { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.mktpos-comm-caption { font-size: 12px; color: #6b7280; white-space: nowrap; }

/* Mode toggle */
.mktpos-comm-mode-toggle { display: flex; gap: 0; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; width: fit-content; }
.mktpos-comm-mode-opt    { display: flex; }
.mktpos-comm-mode-opt input { display: none; }
.mktpos-comm-mode-opt span  {
  display: block; padding: 8px 20px; font-size: 13px; font-weight: 500;
  cursor: pointer; color: #6b7280; background: #fff; transition: background .15s, color .15s;
}
.mktpos-comm-mode-opt input:checked + span { background: var(--mktpos-primary, #ff6b35); color: #fff; }

/* Input + select */
.mktpos-comm-input  {
  height: 36px; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 7px;
  font-size: 13px; background: #fff; outline: none; transition: border-color .15s;
}
.mktpos-comm-input:focus { border-color: var(--mktpos-primary, #ff6b35); }
.mktpos-comm-select {
  height: 36px; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 7px;
  font-size: 13px; background: #fff; cursor: pointer; outline: none;
}
.mktpos-comm-input-row { display: flex; align-items: center; gap: 8px; }
.mktpos-comm-unit { font-size: 13px; font-weight: 600; color: #6b7280; }

/* Tiers */
.mktpos-comm-tier-head {
  display: grid; grid-template-columns: 1fr 1fr 1fr 32px;
  gap: 8px; padding: 0 0 6px; font-size: 11px; font-weight: 600;
  color: #9ca3af; text-transform: uppercase; letter-spacing: .04em;
}
.comm-tier-row  { display: grid; grid-template-columns: 1fr 1fr 1fr 32px; gap: 8px; margin-bottom: 6px; }
.comm-brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.comm-goal-row  { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.comm-goal-row .goal-label  { flex: 1; min-width: 130px; }
.comm-goal-row .goal-target { width: 100px; }
.comm-goal-row .goal-value  { width: 80px; }
.comm-brand-row .brand-rule-pct { width: 80px; }

.mktpos-comm-add-btn {
  margin-top: 8px; padding: 6px 14px; font-size: 12px; font-weight: 600;
  color: var(--mktpos-primary, #ff6b35); background: #fff8f5; border: 1px dashed var(--mktpos-primary, #ff6b35);
  border-radius: 7px; cursor: pointer; transition: background .15s;
}
.mktpos-comm-add-btn:hover { background: #fff0e8; }
.mktpos-comm-remove-btn {
  width: 28px; height: 28px; border: none; background: #fee2e2; color: #ef4444;
  border-radius: 6px; cursor: pointer; font-size: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.mktpos-comm-remove-btn:hover { background: #fca5a5; }

/* Actions row */
.mktpos-comm-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f0f5; }
.comm-save-status    { font-size: 13px; font-weight: 500; }
/* A-CSS-5: scope al contexto de comisiones para no conflictuar con la definición global. */
.mktpos-comm-actions .mktpos-btn-danger {
  background: #fee2e2; color: #dc2626 !important; border: 1px solid #fca5a5;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.mktpos-btn-danger:hover { background: #fca5a5; }

/* ── Calculator ── */
.mktpos-comm-calc-bar {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 16px 20px; margin-bottom: 24px;
}
.mktpos-comm-filter-group { display: flex; flex-direction: column; gap: 4px; }
.mktpos-comm-date-row     { display: flex; align-items: center; gap: 6px; }
.mktpos-comm-presets      { display: flex; gap: 4px; align-items: flex-end; flex-wrap: wrap; }

/* KPI summary strip */
.mktpos-comm-kpis {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 14px 20px; margin-bottom: 20px;
}
.mktpos-comm-kpi        { display: flex; flex-direction: column; gap: 2px; }
.mktpos-comm-kpi-label  { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; }
.mktpos-comm-kpi-value  { font-size: 20px; font-weight: 700; color: #111; }
.mktpos-comm-kpi-value.highlight { color: var(--mktpos-primary, #ff6b35); }
.mktpos-comm-export-btn { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* Result cards */
.mktpos-comm-results     { display: flex; flex-direction: column; gap: 14px; }
.mktpos-comm-result-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  overflow: hidden; transition: box-shadow .15s;
}
.mktpos-comm-result-card:hover  { box-shadow: 0 2px 14px rgba(0,0,0,.07); }
.mktpos-comm-result-card.no-rules { border-color: #fde68a; background: #fffbeb; }

.mktpos-comm-result-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid #f0f0f5;
}
.mktpos-comm-result-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mktpos-comm-warn        { font-size: 12px; color: #b45309; font-weight: 500; }
.mktpos-comm-result-total { text-align: right; }
.mktpos-comm-result-total-label { display: block; font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.mktpos-comm-result-total-value { font-size: 22px; font-weight: 800; color: var(--mktpos-primary, #ff6b35); }

.mktpos-comm-result-body { display: grid; grid-template-columns: 1fr 80px; gap: 0; }
.mktpos-comm-result-breakdown { padding: 14px 20px; }

.mktpos-comm-breakdown-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; font-size: 13px; color: #374151; border-bottom: 1px solid #f9f9fb;
}
.mktpos-comm-breakdown-row.sub { padding-left: 14px; color: #6b7280; font-size: 12px; }
.mktpos-comm-breakdown-row.total-row { font-weight: 700; font-size: 14px; border-top: 2px solid #e5e7eb; border-bottom: none; margin-top: 4px; padding-top: 10px; }
.mktpos-comm-breakdown-row.bonus-reached { color: #16a34a; }
.mktpos-comm-breakdown-row.bonus-pending { color: #9ca3af; font-style: italic; }
.mktpos-comm-breakdown-amt { font-weight: 600; white-space: nowrap; margin-left: 12px; }
.mktpos-comm-breakdown-amt.muted { color: #d1d5db; }

/* Gauge */
.mktpos-comm-result-gauge {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 14px 10px; background: #fafafa; border-left: 1px solid #f0f0f5; gap: 4px;
}
.mktpos-comm-gauge-label   { font-size: 16px; font-weight: 800; color: var(--mktpos-primary, #ff6b35); }
.mktpos-comm-gauge-caption { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.mktpos-comm-gauge-bar {
  width: 18px; height: 80px; background: #e5e7eb; border-radius: 9px;
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
}
.mktpos-comm-gauge-fill {
  width: 100%; background: var(--mktpos-primary, #ff6b35); border-radius: 9px;
  transition: height .5s ease; min-height: 4px;
}

/* Empty state */
.mktpos-comm-empty {
  text-align: center; padding: 48px 24px; color: #9ca3af;
  font-size: 14px; background: #fafafa; border-radius: 12px; border: 1px dashed #e5e7eb;
}

/* ── Compact KPI cards ── */
.mktpos-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.mktpos-kpi-card {
  padding: 18px 18px;
}
.mktpos-kpi-icon svg {
  width: 24px;
  height: 24px;
}
.mktpos-kpi-value {
  font-size: clamp(15px, 1.1vw, 18px);
}

/* ── Seller stats collapse ── */
#mktpos_seller_panel {
  transition: none;
}

/* ── Seller toggle button ── */
.mktpos-seller-toggle-btn {
  background: none;
  border: 1px solid var(--mktpos-border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--mktpos-text-muted);
  transition: background .15s;
  margin-left: auto;
}
.mktpos-seller-toggle-btn:hover { background: var(--mktpos-bg); }

/* ── Table header: sticky to the page top (whole page scrolls, no max-height container) ── */
.mktpos-dash-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.mktpos-col-header-row th {
  background: #1a1a2e;
  color: #fff;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: left;
}
/* ── Column header filter button ── */
.mktpos-cf-hdr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  padding: 2px 3px;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  vertical-align: middle;
  transition: color .15s, background .15s;
  line-height: 1;
}
.mktpos-cf-hdr-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.15);
}
.mktpos-cf-hdr-btn.active {
  color: #f4a261;
}

/* ── Column filter popup ── */
.mktpos-cf-popup {
  background: #fff;
  border: 1px solid var(--mktpos-border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
  z-index: 99999;
  overflow: hidden;
  font-size: 13px;
}
.mktpos-cf-popup-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--mktpos-text-muted, #888);
  border-bottom: 1px solid var(--mktpos-border);
}
.mktpos-cf-popup-inp {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--mktpos-border);
  font-size: 13px;
  color: var(--mktpos-text);
  outline: none;
  box-sizing: border-box;
}
.mktpos-cf-popup-inp:focus {
  background: #f8f9ff;
}
.mktpos-cf-popup-opts {
  max-height: 180px;
  overflow-y: auto;
  padding: 6px 0;
  border-bottom: 1px solid var(--mktpos-border);
}
.mktpos-cf-popup-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--mktpos-text);
  transition: background .12s;
}
.mktpos-cf-popup-opt:hover { background: var(--mktpos-bg); }
.mktpos-cf-popup-opt input[type="radio"] { margin: 0; accent-color: var(--mktpos-brand); }
.mktpos-cf-popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
}
.mktpos-cf-popup-clear {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--mktpos-border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--mktpos-text-muted, #888);
  cursor: pointer;
  transition: background .12s;
}
.mktpos-cf-popup-clear:hover { background: var(--mktpos-bg); }
.mktpos-cf-popup-apply {
  padding: 5px 14px;
  background: var(--mktpos-brand);
  border: 1px solid var(--mktpos-brand);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: opacity .12s;
}
.mktpos-cf-popup-apply:hover { opacity: .85; }

/* ── Column filter — checkbox multiselect ── */
.mktpos-cf-popup-opt input[type="checkbox"] { margin: 0; accent-color: var(--mktpos-brand); cursor: pointer; }

/* ── Column filter — date dropdowns ── */
.mktpos-cf-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--mktpos-border);
}
.mktpos-cf-date-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--mktpos-text-muted, #888);
  width: 32px;
  flex-shrink: 0;
}
.mktpos-cf-date-sel {
  flex: 1;
  padding: 5px 8px;
  border: 1.5px solid var(--mktpos-border);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--mktpos-text);
  background: #fff;
  outline: none;
  cursor: pointer;
}
.mktpos-cf-date-sel:focus { border-color: var(--mktpos-brand); }

/* ── Column filter — sort buttons ── */
.mktpos-cf-sort-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--mktpos-border);
}
.mktpos-cf-sort-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--mktpos-bg, #f5f5f5);
  border: 1.5px solid var(--mktpos-border);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--mktpos-text);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  text-align: left;
}
.mktpos-cf-sort-btn:hover {
  border-color: var(--mktpos-brand);
  color: var(--mktpos-brand);
}
.mktpos-cf-sort-btn.active {
  background: var(--mktpos-brand);
  border-color: var(--mktpos-brand);
  color: #fff;
}

/* ── Column picker ── */
.mktpos-col-picker {
  position: relative;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
}
.mktpos-col-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #fff;
  border: 1.5px solid var(--mktpos-border);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--mktpos-text);
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.mktpos-col-picker-btn:hover {
  background: var(--mktpos-bg);
  border-color: var(--mktpos-brand);
}
.mktpos-col-picker-dd {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--mktpos-border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  z-index: 600;
  padding: 8px 0;
}
.mktpos-col-picker-dd.open { display: block; }
.mktpos-col-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .1s;
  color: var(--mktpos-text);
}
.mktpos-col-picker-item:hover { background: var(--mktpos-bg); }
.mktpos-col-picker-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--mktpos-brand);
}

/* ── Table scroll container — no scroll, table expands naturally ── */
.mktpos-table-scroll {
  overflow-x: auto;  /* permite desplazar para ver la columna Acciones si no cabe */
  overflow-y: visible;
  border-radius: 0 0 var(--mktpos-radius) var(--mktpos-radius);
}

/* ── Dashboard table: fill width, no fixed layout so browser auto-sizes ── */
.mktpos-dash-table {
  table-layout: auto !important;
  width: 100% !important;
}

/* Truncate overflowing text in data cells */
.mktpos-dash-table td {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Client column can be slightly wider */
.mktpos-dash-table td[data-col="cliente"] {
  max-width: 180px;
}
/* Numeric columns: tighter */
.mktpos-dash-table td[data-col="total"],
.mktpos-dash-table td[data-col="pagado"],
.mktpos-dash-table td[data-col="saldo"] {
  max-width: 100px;
}
/* Actions: never clip */
.mktpos-dash-table td[data-col="acciones"] {
  white-space: nowrap;
  overflow: visible;
  max-width: none;
}

/* ── Fila de cotización clickeable ── */
.mktpos-dash-table tbody tr.mktpos-dash-row { cursor: pointer; }

/* ── Celda de fecha: muestra solo el día; la hora completa aparece al instante.
   El tooltip se ancla al <body> por JS (un ::after se recortaría por el
   overflow:hidden de la tabla). ── */
.mktpos-date-cell { white-space: nowrap; cursor: help; }
.mktpos-date-tip {
  position: fixed;
  z-index: 2147483600;
  background: #1a1a2e;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 5px 10px;
  border-radius: 7px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .1s ease, transform .1s ease;
}
.mktpos-date-tip.mktpos-date-tip-in { opacity: 1; transform: translateY(0); }

/* ── Columna "Acciones" fija a la derecha ──
   Queda SIEMPRE visible aunque el resto de columnas necesite scroll horizontal,
   para que los botones (Ver/Editar/PDF/WhatsApp) se vean en cualquier pantalla. */
.mktpos-dash-table th[data-col="acciones"],
.mktpos-dash-table td[data-col="acciones"] {
  position: sticky;
  right: 0;
}
.mktpos-dash-table td[data-col="acciones"] {
  background: #fff;
  z-index: 3;
  box-shadow: -10px 0 12px -10px rgba(0,0,0,.22);
}
.mktpos-dash-table tbody tr:hover td[data-col="acciones"] { background: #f3fbfb; }
.mktpos-dash-table th[data-col="acciones"] {
  background: #1a1a2e;
  z-index: 6;
  box-shadow: -10px 0 12px -10px rgba(0,0,0,.3);
}

/* ── Overlay de carga al navegar a una cotización ──
   Centrado, con fondo desenfocado. Cubre la pantalla para evitar el doble clic. */
.mktpos-navload {
  position: fixed; inset: 0;
  z-index: 2147483600;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,26,46,.30);
  -webkit-backdrop-filter: blur(7px) saturate(120%);
  backdrop-filter: blur(7px) saturate(120%);
  opacity: 0;
  transition: opacity .22s ease;
}
.mktpos-navload.mktpos-navload-in { opacity: 1; }
.mktpos-navload-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
  padding: 30px 40px 26px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  transform: translateY(10px) scale(.97);
  transition: transform .24s cubic-bezier(.2,.7,.3,1);
}
.mktpos-navload.mktpos-navload-in .mktpos-navload-card { transform: translateY(0) scale(1); }
.mktpos-navload-ring {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(1,126,132,.16);
  border-top-color: #017e84;
  animation: mktpos-navload-spin .7s linear infinite;
}
.mktpos-navload-label { font-size: 15px; font-weight: 600; color: #1a1a2e; text-align: center; }
.mktpos-navload-label strong { color: #017e84; font-weight: 700; }
.mktpos-navload-sub { font-size: 12px; color: #9a9aa6; margin-top: -4px; letter-spacing: .02em; }
@keyframes mktpos-navload-spin { to { transform: rotate(360deg); } }

/* ── Adaptive density based on visible column count ── */

/* Compact: 7–9 columns */
.mktpos-dash-table.mktpos-dt-compact .mktpos-col-header-row th {
  padding: 8px 8px;
  font-size: 10px;
}
.mktpos-dash-table.mktpos-dt-compact td {
  padding: 8px 8px;
  font-size: 12px;
}
.mktpos-dash-table.mktpos-dt-compact .mktpos-btn-sm {
  padding: 2px 6px;
  font-size: 10px;
}
.mktpos-dash-table.mktpos-dt-compact .mktpos-badge {
  font-size: 10px;
  padding: 2px 6px;
}

/* Ultra-compact: 10+ columns */
.mktpos-dash-table.mktpos-dt-ultracompact .mktpos-col-header-row th {
  padding: 6px 5px;
  font-size: 9px;
  letter-spacing: 0;
}
.mktpos-dash-table.mktpos-dt-ultracompact td {
  padding: 6px 5px;
  font-size: 11px;
}
.mktpos-dash-table.mktpos-dt-ultracompact .mktpos-btn-sm {
  padding: 2px 5px;
  font-size: 10px;
}
.mktpos-dash-table.mktpos-dt-ultracompact .mktpos-badge {
  font-size: 9px;
  padding: 2px 5px;
}

/* ============================================================
 * MARKETING MODULE
 * ============================================================ */

/* Page header with date filter */
.mkt-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.mkt-date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Tabs */
.mkt-tabs {
  display: flex;
  gap: 4px;
  margin: 20px 0 0;
  border-bottom: 2px solid var(--mktpos-border);
  padding-bottom: 0;
}
.mkt-tab {
  padding: 9px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mktpos-text-muted, #888);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  border-radius: 6px 6px 0 0;
}
.mkt-tab:hover { color: var(--mktpos-brand); }
.mkt-tab.mkt-tab-active {
  color: var(--mktpos-brand);
  border-bottom-color: var(--mktpos-brand);
  background: rgba(var(--mktpos-brand-rgb, 26,26,46), .04);
}

/* Tab panes */
.mkt-tab-pane { display: none; padding-top: 24px; }
.mkt-tab-pane.mkt-tab-pane-active { display: block; }

/* KPI grid */
.mkt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.mkt-kpi-card {
  background: #fff;
  border: 1.5px solid var(--mktpos-border);
  border-radius: 12px;
  padding: 18px 16px 14px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: box-shadow .2s;
}
.mkt-kpi-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }
.mkt-kpi-ic { font-size: 22px; margin-bottom: 6px; }
.mkt-kpi-val { font-size: 22px; font-weight: 800; line-height: 1.1; margin-bottom: 4px; }
.mkt-kpi-lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mktpos-text-muted, #888); }

/* Section bar (title + button row) */
.mkt-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.mkt-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--mktpos-text);
  margin: 0;
}
.mkt-subsection-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--mktpos-text-muted, #888);
  margin: 0 0 10px;
}

/* Form card */
.mkt-form-card {
  background: #fff;
  border: 1.5px solid var(--mktpos-border);
  border-radius: 12px;
  padding: 20px 24px 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.mkt-form-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--mktpos-text);
  margin: 0 0 16px;
}
.mkt-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.mkt-field { display: flex; flex-direction: column; gap: 5px; }
.mkt-field-wide { grid-column: span 2; }
.mkt-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mktpos-text-muted, #888); }
.mkt-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--mktpos-border);
  margin-top: 4px;
}

/* Table helpers */
.mkt-table { width: 100%; }
.mkt-table thead th { font-size: 10.5px; white-space: nowrap; }
.mkt-table tbody td { font-size: 13px; }
.ta-r { text-align: right !important; }
.mkt-num { color: var(--mktpos-text-muted, #888); font-size: 12px; }

/* Platform chips */
.mkt-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--mktpos-bg);
  color: var(--mktpos-text);
  border: 1px solid var(--mktpos-border);
}
.mkt-chip-metaa  { background: #e7f0fd; color: #1a1aff; border-color: #b3c9fb; }
.mkt-chip-googl  { background: #fef3e2; color: #e37400; border-color: #fbd399; }
.mkt-chip-tikto  { background: #ffe8f5; color: #c0006a; border-color: #f5b8db; }
.mkt-chip-youtu  { background: #ffe9e9; color: #cc0000; border-color: #ffbcbc; }
.mkt-chip-linke  { background: #e8f4fb; color: #0a66c2; border-color: #b3d9f5; }

/* A-CSS-5: variante outline, scope a la sección de marketing para no romper el botón global. */
.mktpos-marketing .mktpos-btn-danger--outline,
.mktpos-marketing-section .mktpos-btn-danger--outline {
  background: transparent;
  border: 1.5px solid #e63946;
  color: #e63946 !important;
  font-weight: 700;
  font-size: 13px;
}
.mktpos-marketing .mktpos-btn-danger--outline:hover,
.mktpos-marketing-section .mktpos-btn-danger--outline:hover { background: #e63946; color: #fff !important; }

/* Responsive */
@media (max-width: 768px) {
  .mkt-page-header { flex-direction: column; }
  .mkt-date-filter { flex-direction: column; align-items: flex-start; }
  .mkt-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .mkt-form-grid { grid-template-columns: 1fr 1fr; }
  .mkt-field-wide { grid-column: span 2; }
  .mkt-tabs { overflow-x: auto; }
  .mkt-tab { white-space: nowrap; }
}
@media (max-width: 480px) {
  .mkt-kpi-grid { grid-template-columns: 1fr 1fr; }
  .mkt-form-grid { grid-template-columns: 1fr; }
  .mkt-field-wide { grid-column: span 1; }
}

/* ============================================================
 * Modal overlay (compartido por chat, tasks, DMs, grupos, etc.)
 * Sin estas reglas los .mktpos-modal-backdrop renderizan inline
 * en lugar de flotar como overlay.
 * ============================================================ */
.mktpos-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: mktpos-modal-fade-in .15s ease;
}

@keyframes mktpos-modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mktpos-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: mktpos-modal-scale-in .18s cubic-bezier(.2, .8, .2, 1);
}

@keyframes mktpos-modal-scale-in {
  from { transform: scale(.94); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.mktpos-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eef0f3;
}

.mktpos-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111;
}

.mktpos-modal-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0 4px;
  border-radius: 6px;
  transition: background .12s, color .12s;
}

.mktpos-modal-close:hover {
  color: #111;
  background: #f3f4f6;
}

.mktpos-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

@media (max-width: 480px) {
  .mktpos-modal {
    border-radius: 12px;
    max-height: 95vh;
  }
  .mktpos-modal-backdrop { padding: 10px; }
}

/* ============================================================
 * A-CSS-7: focus-visible por defecto para todos los elementos
 * interactivos dentro del wrap del plugin. Restaura indicador
 * de foco para usuarios de teclado (WCAG 2.4.7).
 * ============================================================ */
.mktpos-wrap a:focus-visible,
.mktpos-wrap button:focus-visible,
.mktpos-wrap input:focus-visible,
.mktpos-wrap textarea:focus-visible,
.mktpos-wrap select:focus-visible,
.mktpos-wrap [role="button"]:focus-visible,
.mktpos-wrap [tabindex]:focus-visible {
  outline: 2px solid var(--mktpos-brand, #0077b6);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 119, 182, .25);
}

/* ============================================================
 * Accesibilidad: respetar preferencia de "reduce motion"
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .mktpos-wrap *,
  .mktpos-wrap *::before,
  .mktpos-wrap *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
 * Estilos de impresión: cotizaciones, recibos, etiquetas
 * deben imprimir limpios sin sidebar/navbar/botones.
 * ============================================================ */
@media print {
  .mktpos-navbar,
  .mktpos-sidebar,
  .mktpos-sticky-footer,
  .mktpos-toast,
  .mktpos-fab,
  .mktpos-modal,
  .mktpos-modal-backdrop,
  .mktpos-no-print,
  .no-print,
  .mktpos-btn,
  .mktpos-btn-primary,
  .mktpos-btn-secondary {
    display: none !important;
  }

  body,
  .mktpos-wrap {
    background: #fff !important;
    color: #000 !important;
    min-height: 0 !important;
  }

  .mktpos-content,
  .mktpos-content-inner,
  .mktpos-card {
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }

  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  /* Forzar legibilidad y romper líneas en impresión */
  * { box-shadow: none !important; }
  table { page-break-inside: auto; }
  tr    { page-break-inside: avoid; page-break-after: auto; }

  /* Ocultar burbuja de chat al imprimir. */
  #mktpos-chat-bubble-root { display: none !important; }
}

/* ============================================================
 * Floating Chat Bubble (Intercom-style)
 * ============================================================ */
#mktpos-chat-bubble-root {
  --mkb-color: #1d4ed8;
  --mkb-bg: #fff;
  --mkb-border: #e5e7eb;
  --mkb-text: #111827;
  --mkb-muted: #6b7280;
  --mkb-shadow: 0 12px 40px rgba(0, 0, 0, .18), 0 2px 10px rgba(0, 0, 0, .08);
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--mkb-text);
}

#mktpos-chat-bubble-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--mkb-color);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--mkb-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform .15s, box-shadow .15s;
  padding: 0;
}
#mktpos-chat-bubble-btn:hover { transform: scale(1.05); }
#mktpos-chat-bubble-btn:active { transform: scale(.96); }
#mktpos-chat-bubble-btn[aria-expanded="true"] { transform: scale(.92); }

#mktpos-chat-bubble-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
}
#mktpos-chat-bubble-badge[hidden] { display: none !important; }

#mktpos-chat-bubble-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: var(--mkb-bg);
  border-radius: 16px;
  box-shadow: var(--mkb-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mkb-pop .18s cubic-bezier(.2, .8, .2, 1);
  transform-origin: bottom right;
}
#mktpos-chat-bubble-panel[hidden] { display: none !important; }

@keyframes mkb-pop {
  from { opacity: 0; transform: scale(.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* Header */
.mkb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 12px;
  background: var(--mkb-color);
  color: #fff;
  flex-shrink: 0;
}
.mkb-header .mkb-back {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.mkb-header .mkb-back[hidden] { display: none !important; }
.mkb-header .mkb-back:hover { background: rgba(255,255,255,.15); }
.mkb-title {
  font-weight: 700;
  font-size: 15px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mkb-header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.mkb-header-actions .mkb-expand,
.mkb-header-actions .mkb-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}
.mkb-header-actions .mkb-expand:hover,
.mkb-header-actions .mkb-close:hover { background: rgba(255,255,255,.15); }
.mkb-close { font-size: 22px; font-weight: 400; }

/* Views */
.mkb-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mkb-view[hidden] { display: none !important; }

.mkb-view-list {
  overflow-y: auto;
  padding: 6px 0;
}

.mkb-channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  position: relative;
  font: inherit;
  color: inherit;
}
.mkb-channel-item:hover { background: #f9fafb; }
.mkb-channel-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.mkb-channel-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mkb-channel-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mkb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mkb-channel-preview {
  font-size: 12px;
  color: var(--mkb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mkb-has-unread .mkb-channel-name { font-weight: 700; }
.mkb-has-unread .mkb-channel-preview { color: var(--mkb-text); font-weight: 500; }
.mkb-channel-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--mkb-color);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mkb-list-section { padding: 8px 0; }
.mkb-empty-title {
  padding: 24px 18px 4px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
.mkb-empty-sub {
  padding: 0 18px 12px;
  font-size: 12.5px;
  color: var(--mkb-muted);
  text-align: center;
}
.mkb-user-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 8px;
}
.mkb-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}
.mkb-user-item:hover { background: #f9fafb; }
.mkb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mkb-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.mkb-user-name {
  font-size: 13.5px;
  font-weight: 500;
}

/* Chat view */
.mkb-view-chat { flex: 1; }
.mkb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mkb-loading,
.mkb-empty-chat {
  text-align: center;
  color: var(--mkb-muted);
  font-size: 13px;
  margin-top: 30px;
}
.mkb-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 80%;
}
.mkb-msg-mine { align-self: flex-end; align-items: flex-end; }
.mkb-msg-from {
  font-size: 10.5px;
  color: var(--mkb-muted);
  margin-bottom: 2px;
  padding: 0 6px;
}
.mkb-msg-bubble {
  background: #f3f4f6;
  color: var(--mkb-text);
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.mkb-msg-mine .mkb-msg-bubble {
  background: var(--mkb-color);
  color: #fff;
}
.mkb-msg-time {
  font-size: 10px;
  color: var(--mkb-muted);
  margin-top: 2px;
  padding: 0 6px;
}

.mkb-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--mkb-border);
  background: #fff;
  flex-shrink: 0;
}
.mkb-input-bar textarea {
  flex: 1;
  border: 1px solid var(--mkb-border);
  border-radius: 18px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13.5px;
  resize: none;
  outline: none;
  max-height: 100px;
  font-family: inherit;
  line-height: 1.4;
}
.mkb-input-bar textarea:focus {
  border-color: var(--mkb-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .04);
}
.mkb-send {
  background: var(--mkb-color);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .12s;
}
.mkb-send:disabled { opacity: .5; cursor: not-allowed; }
.mkb-send svg { transform: translateX(-1px); }

/* Móvil: ocupa más pantalla */
@media (max-width: 480px) {
  #mktpos-chat-bubble-root {
    bottom: 16px;
    right: 16px;
  }
  #mktpos-chat-bubble-panel {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    bottom: 72px;
  }
}

/* ============================================================
 * Status dots (presencia: active / busy / offline)
 * ============================================================ */
.mkb-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca3af;
  border: 2px solid #fff;
  box-sizing: border-box;
  vertical-align: middle;
}
.mkb-status-dot.mkb-status-active  { background: #22c55e; }
.mkb-status-dot.mkb-status-busy    { background: #f59e0b; }
.mkb-status-dot.mkb-status-offline { background: #9ca3af; }

/* Dot en el botón de la burbuja (esquina inferior derecha del círculo) */
#mktpos-chat-bubble-btn .mkb-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-width: 2.5px;
}

/* Avatar wrapper con dot overlay */
.mkb-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.mkb-avatar-wrap .mkb-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
}
.mkb-channel-icon-wrap {
  position: relative;
  flex-shrink: 0;
}
.mkb-channel-icon-wrap .mkb-dot-overlay {
  position: absolute;
  bottom: -2px;
  right: -2px;
}

/* Subtítulo del header (last seen en DMs) */
.mkb-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.mkb-title-sub {
  font-size: 11.5px;
  opacity: .85;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mkb-title-sub[hidden] { display: none !important; }

/* Status selector en header */
.mkb-status-btn {
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.mkb-status-btn:hover { background: rgba(255,255,255,.25); }
.mkb-status-btn .mkb-status-dot {
  width: 12px;
  height: 12px;
  border-color: #fff;
}

.mkb-status-menu {
  position: absolute;
  top: 54px;
  right: 64px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
  min-width: 160px;
}
.mkb-status-menu[hidden] { display: none !important; }
.mkb-status-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
  color: #111;
  font-family: inherit;
}
.mkb-status-opt:hover { background: #f3f4f6; }

/* Presencia en lista de usuarios */
.mkb-user-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mkb-user-presence {
  font-size: 11.5px;
  color: var(--mkb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
 * Read receipts (palomitas ✓ / ✓✓)
 * ============================================================ */
.mkb-msg-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 0 6px;
  font-size: 10px;
  color: var(--mkb-muted);
}
.mkb-msg-mine .mkb-msg-meta { justify-content: flex-end; }
.mkb-msg-receipt {
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
}
.mkb-receipt-sent { color: #9ca3af; }    /* ✓ enviado, gris */
.mkb-receipt-read { color: var(--mkb-color); }  /* ✓✓ leído, color marca */
