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

:root {
  --mktpos-brand: #0077b6;
  --mktpos-brand-rgb: 0 119 182;
  --mktpos-brand-weak: rgba(0,119,182,.12);
  --mktpos-brand-soft: rgba(0,119,182,.06);
  --mktpos-brand-border: rgba(0,119,182,.20);

  --mktpos-bg: #f0f2f5;
  --mktpos-card: #ffffff;
  --mktpos-text: #1a1a2e;
  --mktpos-text-secondary: #555;
  --mktpos-text-muted: #888;
  --mktpos-border: #e0e0e0;
  --mktpos-radius: 12px;
  --mktpos-radius-sm: 8px;
  --mktpos-shadow: 0 2px 12px rgba(0,0,0,.06);
  --mktpos-shadow-lg: 0 8px 32px rgba(0,0,0,.10);

  /* Vibrant colors */
  --mktpos-success: #2d6a4f;
  --mktpos-success-bg: #d8f3dc;
  --mktpos-danger: #e63946;
  --mktpos-danger-bg: #fde8ea;
  --mktpos-warning: #f4a261;
  --mktpos-warning-bg: #fff3e0;
  --mktpos-info: #0077b6;
  --mktpos-info-bg: #e0f4ff;
  --mktpos-purple: #7209b7;
  --mktpos-purple-bg: #f3e5f5;
  --mktpos-emerald: #00b894;
  --mktpos-emerald-bg: #e0f7f0;
}

/* ============================================================
 * Reset & Base
 * ============================================================ */
.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;
}
.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; }

/* ============================================================
 * NAVBAR
 * ============================================================ */
.mktpos-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: var(--mktpos-radius);
  margin-bottom: 24px;
  box-shadow: var(--mktpos-shadow-lg);
  flex-wrap: wrap;
  gap: 12px;
}
.mktpos-navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mktpos-nav-logo {
  height: 36px;
  width: auto;
  border-radius: 6px;
}
.mktpos-nav-title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
}
.mktpos-navbar-links {
  display: flex;
  gap: 4px;
}
.mktpos-nav-link {
  color: rgba(255,255,255,.7) !important;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  text-decoration: none !important;
}
.mktpos-nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,.12);
  text-decoration: none !important;
}
.mktpos-nav-active {
  color: #fff !important;
  background: rgba(255,255,255,.18) !important;
  font-weight: 600;
}
.mktpos-navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mktpos-nav-user-info {
  display: flex;
  flex-direction: column;
  text-align: right;
}
.mktpos-nav-user-info strong {
  color: #fff;
  font-size: 14px;
}
.mktpos-nav-user-info small {
  color: rgba(255,255,255,.5);
  font-size: 11px;
}

/* ============================================================
 * BUTTONS
 * ============================================================ */
.mktpos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--mktpos-radius-sm);
  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:hover { background: linear-gradient(135deg, #d35400 0%, #e76f51 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 var(--mktpos-border);
}
.mktpos-btn-ghost:hover { background: var(--mktpos-bg); }

.mktpos-btn-logout {
  background: var(--mktpos-danger) !important;
  color: #fff !important;
  padding: 8px 16px;
  font-size: 13px;
}

.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: var(--mktpos-card);
  border-radius: var(--mktpos-radius);
  box-shadow: var(--mktpos-shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.mktpos-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mktpos-border);
  flex-wrap: wrap;
  gap: 12px;
}
.mktpos-card-header h3 {
  font-size: 16px;
  color: var(--mktpos-text);
}
.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: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  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-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px 40px;
}
.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: 28px;
  color: var(--mktpos-text);
}
.mktpos-subtitle {
  color: var(--mktpos-text-secondary);
  margin-top: 4px;
  font-size: 14px;
}

/* ============================================================
 * 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: var(--mktpos-radius);
  box-shadow: var(--mktpos-shadow);
  transition: transform .2s;
}
.mktpos-kpi-card:hover { transform: translateY(-2px); }
.mktpos-kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mktpos-kpi-value {
  display: block;
  font-size: 17px;
  font-weight: 800;
}
.mktpos-kpi-label {
  display: block;
  font-size: 13px;
  margin-top: 2px;
}

/* KPI Colors - VIBRANT */
.mktpos-kpi-blue {
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 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, #2d6a4f 0%, #52b788 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, #e76f51 0%, #f4a261 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, #00b894 0%, #55efc4 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, #7209b7 0%, #b5179e 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, #e63946 0%, #f08080 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: 20px 24px;
  border-bottom: 1px solid var(--mktpos-border);
}
.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;
}
.mktpos-seller-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--mktpos-radius-sm);
  border-left: 4px solid var(--mktpos-brand, #0077b6);
  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: #2d6a4f !important; }
.mktpos-text-emerald { color: #00b894 !important; }
.mktpos-text-orange { color: #e76f51 !important; }
.mktpos-text-danger { color: #e63946 !important; }
.mktpos-text-blue { color: #0077b6 !important; }
.mktpos-text-purple { color: #7209b7 !important; }

.mktpos-badge-brand {
  background: linear-gradient(135deg, var(--mktpos-brand, #0077b6), #00b4d8) !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-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mktpos-filter-select {
  width: 180px;
}
.mktpos-dash-table-wrap {
  overflow-x: auto;
}
.mktpos-table-scroll {
  overflow-x: auto;
}
.mktpos-dash-table {
  width: 100%;
  border-collapse: collapse;
}
.mktpos-dash-table th {
  padding: 12px 14px;
  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);
  white-space: nowrap;
}
.mktpos-dash-table td {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--mktpos-border);
  vertical-align: middle;
}
.mktpos-dash-table tr:hover td {
  background: var(--mktpos-brand-soft);
}
.mktpos-dash-actions {
  white-space: nowrap;
}
.mktpos-dash-actions .mktpos-btn {
  margin-right: 4px;
}
.mktpos-dash-pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 16px 20px;
}
.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: auto;
  -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;
  }
}

@media (max-width: 768px) {
  .mktpos-navbar {
    padding: 12px 16px;
  }
  .mktpos-navbar-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .mktpos-nav-link {
    font-size: 13px;
    padding: 6px 12px;
  }
  .mktpos-content {
    padding: 0 12px 32px;
  }
  .mktpos-page-header h1 {
    font-size: 22px;
  }
  .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;
  }
}

@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 16px 80px;
}

/* ---- Header ---- */
.mktpos-odoo-header {
  background: #fff;
  border-bottom: 1px solid #e8e8ed;
  padding: 24px 0 16px;
  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 16px;
  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; }

/* 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; }

/* 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: #e63946; 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: 10px 16px;
  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: 10px 16px;
  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: 16px;
  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; }
.mktpos-odoo-save-actions { display: flex; align-items: center; gap: 12px; }

/* 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; }
