/**
 * MiMarket Design System v3.3
 * Tokens, layout shell, componentes reutilizables
 */

:root {
  /* Colores */
  --mm-primary: #16a34a;
  --mm-primary-hover: #15803d;
  --mm-primary-muted: #dcfce7;
  --mm-primary-subtle: #f0fdf4;
  --mm-bg: #f8fafc;
  --mm-surface: #ffffff;
  --mm-surface-raised: #ffffff;
  --mm-text: #0f172a;
  --mm-text-secondary: #475569;
  --mm-text-muted: #64748b;
  --mm-text-help: #94a3b8;
  --mm-border: #e5e7eb;
  --mm-border-strong: #cbd5e1;
  --mm-danger: #dc2626;
  --mm-danger-bg: #fef2f2;
  --mm-warning: #d97706;
  --mm-warning-bg: #fffbeb;
  --mm-info: #2563eb;
  --mm-info-bg: #eff6ff;

  /* Espaciado */
  --mm-space-1: 4px;
  --mm-space-2: 8px;
  --mm-space-3: 12px;
  --mm-space-4: 16px;
  --mm-space-5: 24px;
  --mm-space-6: 32px;
  --mm-space-7: 48px;

  /* Radios */
  --mm-radius-sm: 8px;
  --mm-radius: 12px;
  --mm-radius-lg: 14px;
  --mm-radius-full: 9999px;

  /* Sombras */
  --mm-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --mm-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --mm-shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.08);
  --mm-shadow-focus: 0 0 0 3px rgba(22, 163, 74, 0.2);

  /* Tipografía */
  --mm-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mm-text-title: 24px;
  --mm-text-subtitle: 16px;
  --mm-text-body: 14px;
  --mm-text-help-size: 12px;

  /* Layout */
  --mm-sidebar-w: 240px;
  --mm-topbar-h: 64px;
  --mm-input-h: 48px;
  --mm-content-max: 1440px;

  /* Transiciones */
  --mm-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --mm-duration: 150ms;
}

body.dark-mode {
  --mm-bg: #0f172a;
  --mm-surface: #1e293b;
  --mm-surface-raised: #334155;
  --mm-text: #f1f5f9;
  --mm-text-secondary: #cbd5e1;
  --mm-text-muted: #94a3b8;
  --mm-text-help: #64748b;
  --mm-border: #334155;
  --mm-border-strong: #475569;
  --mm-primary-muted: #14532d;
  --mm-primary-subtle: #052e16;
  --mm-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
  --mm-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ─── App shell ─── */
.mm-app {
  font-family: var(--mm-font);
  font-size: var(--mm-text-body);
  color: var(--mm-text);
  background: var(--mm-bg);
  min-height: 100vh;
  line-height: 1.5;
}

.mm-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.mm-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: var(--mm-sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--mm-surface);
  border-right: 1px solid var(--mm-border);
  box-shadow: var(--mm-shadow-sm);
  transition: transform var(--mm-duration) var(--mm-ease);
}

.mm-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--mm-space-3);
  height: var(--mm-topbar-h);
  padding: 0 var(--mm-space-4);
  border-bottom: 1px solid var(--mm-border);
  flex-shrink: 0;
}

.mm-sidebar__brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--mm-radius-sm);
}

.mm-sidebar__brand-text h1 {
  font-size: var(--mm-text-subtitle);
  font-weight: 600;
  color: var(--mm-text);
  line-height: 1.2;
  margin: 0;
}

.mm-sidebar__brand-text p {
  font-size: var(--mm-text-help-size);
  color: var(--mm-text-muted);
  margin: 0;
}

.mm-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--mm-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--mm-space-1);
}

.mm-sidebar__nav .mod-btn {
  display: flex;
  align-items: center;
  gap: var(--mm-space-3);
  width: 100%;
  padding: var(--mm-space-3) var(--mm-space-4);
  border: none;
  border-radius: var(--mm-radius);
  background: transparent;
  color: var(--mm-text-secondary);
  font-size: var(--mm-text-body);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--mm-duration) var(--mm-ease), color var(--mm-duration) var(--mm-ease);
}

.mm-sidebar__nav .mod-btn:hover {
  background: var(--mm-primary-subtle);
  color: var(--mm-primary-hover);
}

.mm-sidebar__nav .mod-btn.mod-active {
  background: var(--mm-primary-muted) !important;
  color: var(--mm-primary-hover) !important;
  font-weight: 600;
}

.mm-sidebar__nav .mod-btn.hidden {
  display: none !important;
}

.mm-sidebar__nav .mod-btn .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.mm-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}

.mm-sidebar-backdrop.is-open {
  display: block;
}

@media (max-width: 1023px) {
  .mm-sidebar {
    transform: translateX(-100%);
  }
  .mm-sidebar.is-open {
    transform: translateX(0);
  }
}

/* ─── Main area ─── */
.mm-main {
  flex: 1;
  margin-left: var(--mm-sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (max-width: 1023px) {
  .mm-main {
    margin-left: 0;
  }
}

/* ─── Topbar ─── */
.mm-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--mm-space-4);
  height: var(--mm-topbar-h);
  padding: 0 var(--mm-space-5);
  background: var(--mm-surface);
  border-bottom: 1px solid var(--mm-border);
  box-shadow: var(--mm-shadow-sm);
}

.mm-topbar__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius-sm);
  background: var(--mm-surface);
  color: var(--mm-text);
  cursor: pointer;
  font-size: 18px;
}

@media (max-width: 1023px) {
  .mm-topbar__menu-btn {
    display: flex;
  }
}

.mm-topbar__spacer {
  flex: 1;
  min-width: 0;
}

.mm-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--mm-space-2);
  flex-shrink: 0;
}

/* ─── User menu ─── */
.mm-user-menu {
  position: relative;
}

.mm-user-menu__trigger {
  display: flex;
  align-items: center;
  gap: var(--mm-space-3);
  padding: var(--mm-space-2) var(--mm-space-3);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  background: var(--mm-surface);
  color: var(--mm-text);
  cursor: pointer;
  transition: border-color var(--mm-duration), box-shadow var(--mm-duration);
  max-width: 220px;
}

.mm-user-menu__trigger:hover {
  border-color: var(--mm-border-strong);
  box-shadow: var(--mm-shadow-sm);
}

.mm-user-menu__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--mm-radius-full);
  background: var(--mm-primary-muted);
  color: var(--mm-primary-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--mm-text-help-size);
  flex-shrink: 0;
}

.mm-user-menu__info {
  text-align: left;
  min-width: 0;
  overflow: hidden;
}

#mm-user-name {
  display: block;
  font-size: var(--mm-text-body);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#mm-user-role {
  display: block;
  font-size: var(--mm-text-help-size);
  color: var(--mm-text-muted);
}

.mm-dropdown {
  position: absolute;
  top: calc(100% + var(--mm-space-2));
  right: 0;
  min-width: 260px;
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow-lg);
  padding: var(--mm-space-2);
  z-index: 50;
  animation: mm-fade-in 0.15s var(--mm-ease);
}

.mm-dropdown__section {
  padding: var(--mm-space-2) var(--mm-space-3);
  border-bottom: 1px solid var(--mm-border);
}

.mm-dropdown__section:last-child {
  border-bottom: none;
}

.mm-dropdown__clock {
  font-family: ui-monospace, monospace;
  font-size: var(--mm-text-help-size);
  color: var(--mm-text-muted);
}

.mm-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--mm-space-3);
  width: 100%;
  padding: var(--mm-space-3);
  border: none;
  border-radius: var(--mm-radius-sm);
  background: transparent;
  color: var(--mm-text);
  font-size: var(--mm-text-body);
  text-align: left;
  cursor: pointer;
  transition: background var(--mm-duration);
}

.mm-dropdown__item:hover {
  background: var(--mm-bg);
}

.mm-dropdown__item--danger {
  color: var(--mm-danger);
}

.mm-dropdown__item--danger:hover {
  background: var(--mm-danger-bg);
}

/* ─── Content + grid ─── */
.mm-content {
  flex: 1;
  padding: var(--mm-space-5);
  max-width: var(--mm-content-max);
  width: 100%;
  margin: 0 auto;
}

.mm-content.mm-content--wide {
  max-width: none;
  margin: 0;
  padding-left: var(--mm-space-4);
  padding-right: var(--mm-space-4);
}

.mm-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--mm-space-5);
}

.mm-col-7 { grid-column: span 7; }
.mm-col-5 { grid-column: span 5; }
.mm-col-12 { grid-column: span 12; }

@media (max-width: 1023px) {
  .mm-col-7, .mm-col-5 { grid-column: span 12; }
  .mm-content { padding: var(--mm-space-4); }
}

/* ─── Typography ─── */
.mm-title {
  font-size: var(--mm-text-title);
  font-weight: 600;
  color: var(--mm-text);
  line-height: 1.25;
  margin: 0;
}

.mm-subtitle {
  font-size: var(--mm-text-subtitle);
  font-weight: 500;
  color: var(--mm-text);
}

.mm-text-muted {
  color: var(--mm-text-muted);
}

.mm-text-help {
  font-size: var(--mm-text-help-size);
  color: var(--mm-text-help);
}

/* ─── Cards ─── */
.ds-card {
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow);
  overflow: hidden;
}

.ds-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--mm-space-4) var(--mm-space-5);
  border-bottom: 1px solid var(--mm-border);
}

.ds-card__body {
  padding: var(--mm-space-5);
}

.ds-card__footer {
  padding: var(--mm-space-5);
  border-top: 1px solid var(--mm-border);
  background: var(--mm-bg);
}

/* ─── Buttons ─── */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mm-space-2);
  height: var(--mm-input-h);
  padding: 0 var(--mm-space-5);
  border: 1px solid transparent;
  border-radius: var(--mm-radius);
  font-size: var(--mm-text-body);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--mm-duration), transform 0.1s, box-shadow var(--mm-duration), opacity var(--mm-duration);
  white-space: nowrap;
}

.ds-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.ds-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ds-btn--primary {
  background: var(--mm-primary);
  color: #fff;
}

.ds-btn--primary:hover:not(:disabled) {
  background: var(--mm-primary-hover);
  box-shadow: var(--mm-shadow);
}

.ds-btn--secondary {
  background: var(--mm-surface);
  color: var(--mm-text);
  border-color: var(--mm-border);
}

.ds-btn--secondary:hover:not(:disabled) {
  background: var(--mm-bg);
  border-color: var(--mm-border-strong);
}

.ds-btn--ghost {
  background: transparent;
  color: var(--mm-text-muted);
}

.ds-btn--ghost:hover:not(:disabled) {
  background: var(--mm-bg);
  color: var(--mm-text);
}

.ds-btn--danger-ghost {
  background: transparent;
  color: var(--mm-danger);
  height: auto;
  padding: var(--mm-space-2) var(--mm-space-3);
  font-size: var(--mm-text-help-size);
  font-weight: 500;
}

.ds-btn--cobrar {
  width: 100%;
  height: 60px;
  font-size: var(--mm-text-subtitle);
  letter-spacing: 0.02em;
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow);
}

.ds-btn--cobrar:not(:disabled):hover {
  box-shadow: var(--mm-shadow-lg);
}

.ds-btn--sm {
  height: 36px;
  padding: 0 var(--mm-space-4);
  font-size: var(--mm-text-help-size);
}

.ds-btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  flex-shrink: 0;
}

/* ─── Inputs ─── */
.ds-input,
.ds-select,
.ds-textarea {
  width: 100%;
  height: var(--mm-input-h);
  padding: 0 var(--mm-space-4);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  background: var(--mm-surface);
  color: var(--mm-text);
  font-size: var(--mm-text-body);
  transition: border-color var(--mm-duration), box-shadow var(--mm-duration);
}

.ds-input:focus,
.ds-select:focus,
.ds-textarea:focus {
  outline: none;
  border-color: var(--mm-primary);
  box-shadow: var(--mm-shadow-focus);
}

.ds-input--hero {
  height: 56px;
  font-size: var(--mm-text-subtitle);
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow);
  border-color: var(--mm-border-strong);
}

.ds-input--hero:focus {
  box-shadow: var(--mm-shadow-focus), var(--mm-shadow);
}

.ds-textarea {
  height: auto;
  min-height: 80px;
  padding: var(--mm-space-3) var(--mm-space-4);
  resize: vertical;
}

.ds-label {
  display: block;
  font-size: var(--mm-text-help-size);
  font-weight: 600;
  color: var(--mm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--mm-space-2);
}

/* ─── Badges ─── */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--mm-space-1);
  padding: var(--mm-space-1) var(--mm-space-3);
  border-radius: var(--mm-radius-full);
  font-size: var(--mm-text-help-size);
  font-weight: 600;
  white-space: nowrap;
}

.ds-badge--neutral {
  background: var(--mm-bg);
  color: var(--mm-text-secondary);
  border: 1px solid var(--mm-border);
}

.ds-badge--success {
  background: var(--mm-primary-subtle);
  color: var(--mm-primary-hover);
}

.ds-badge--warning {
  background: var(--mm-warning-bg);
  color: var(--mm-warning);
}

.ds-badge--danger {
  background: var(--mm-danger-bg);
  color: var(--mm-danger);
}

/* ─── Alerts / Banners ─── */
.ds-alert {
  display: flex;
  align-items: center;
  gap: var(--mm-space-3);
  padding: var(--mm-space-3) var(--mm-space-4);
  border-radius: var(--mm-radius);
  font-size: var(--mm-text-body);
  border: 1px solid transparent;
}

.ds-alert--warning {
  background: var(--mm-warning-bg);
  border-color: #fde68a;
  color: #92400e;
}

.ds-alert--danger {
  background: var(--mm-danger-bg);
  border-color: #fecaca;
  color: #991b1b;
}

.ds-plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mm-space-3);
  padding: var(--mm-space-2) var(--mm-space-4);
  border-radius: var(--mm-radius);
  font-size: var(--mm-text-help-size);
  flex: 1;
  min-width: 0;
  max-width: 480px;
}

.ds-plan-banner--danger {
  background: var(--mm-danger-bg);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.ds-plan-banner--info {
  background: var(--mm-primary-subtle);
  border: 1px solid var(--mm-primary-muted);
  color: var(--mm-primary-hover);
}

/* ─── Tabs ─── */
.ds-tabs {
  display: flex;
  gap: var(--mm-space-1);
  padding: var(--mm-space-1);
  background: var(--mm-bg);
  border-radius: var(--mm-radius);
  margin-bottom: var(--mm-space-4);
  flex-wrap: wrap;
}

.tab-btn {
  padding: var(--mm-space-2) var(--mm-space-4);
  border: none;
  border-radius: var(--mm-radius-sm);
  background: transparent;
  color: var(--mm-text-muted);
  font-size: var(--mm-text-body);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--mm-duration), color var(--mm-duration);
  border-bottom: none !important;
}

.tab-btn:hover {
  color: var(--mm-text);
  background: var(--mm-surface);
}

.tab-btn.tab-active {
  background: var(--mm-surface) !important;
  color: var(--mm-primary-hover) !important;
  font-weight: 600;
  box-shadow: var(--mm-shadow-sm);
}

/* ─── POS search ─── */
.pos-search-hero {
  position: relative;
  margin-bottom: var(--mm-space-5);
}

.pos-search-hero__icon {
  position: absolute;
  left: var(--mm-space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  pointer-events: none;
  opacity: 0.5;
}

.pos-search-hero .ds-input--hero {
  padding-left: var(--mm-space-7);
}

.pos-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + var(--mm-space-2));
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow-lg);
  z-index: 20;
  max-height: 320px;
  overflow: auto;
}

/* ─── Cart ─── */
.cart-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 520px;
}

.cart-items-wrap {
  flex: 1;
  overflow: auto;
  padding: var(--mm-space-4);
  min-height: 200px;
  max-height: 360px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--mm-space-7) var(--mm-space-4);
  color: var(--mm-text-muted);
  text-align: center;
  gap: var(--mm-space-2);
}

.cart-empty__icon {
  font-size: 40px;
  opacity: 0.35;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--mm-space-3);
  align-items: center;
  padding: var(--mm-space-4);
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  margin-bottom: var(--mm-space-2);
  animation: mm-fade-in 0.15s var(--mm-ease);
}

.cart-item__info {
  min-width: 0;
}

.cart-item__name {
  font-weight: 600;
  font-size: var(--mm-text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item__price {
  font-size: var(--mm-text-help-size);
  color: var(--mm-text-muted);
}

.cart-item__actions {
  display: flex;
  align-items: center;
  gap: var(--mm-space-2);
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: var(--mm-space-1);
}

.cart-item__subtotal {
  font-weight: 700;
  min-width: 72px;
  text-align: right;
  color: var(--mm-text);
}

.qty-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius-sm);
  background: var(--mm-surface);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--mm-duration), border-color var(--mm-duration);
}

.qty-btn:hover {
  background: var(--mm-primary-subtle);
  border-color: var(--mm-primary);
}

.qty-value {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: var(--mm-text-subtitle);
}

.rm-btn {
  padding: var(--mm-space-2) var(--mm-space-3);
  border: none;
  background: transparent;
  color: var(--mm-danger);
  font-size: var(--mm-text-help-size);
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--mm-radius-sm);
}

.rm-btn:hover {
  background: var(--mm-danger-bg);
}

/* ─── Total block ─── */
.cart-total-block {
  padding: var(--mm-space-5) 0;
  border-top: 1px solid var(--mm-border);
  border-bottom: 1px solid var(--mm-border);
  margin: var(--mm-space-4) 0;
  text-align: center;
}

.cart-total-block__label {
  font-size: var(--mm-text-help-size);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mm-text-muted);
  margin-bottom: var(--mm-space-1);
}

#cart-total {
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 700;
  color: var(--mm-primary-hover);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

#cart-summary {
  font-size: var(--mm-text-help-size);
  color: var(--mm-text-secondary);
  margin-bottom: var(--mm-space-3);
}

/* ─── Module cards global polish ─── */
.mm-content .module .bg-white {
  background: var(--mm-surface) !important;
  border-color: var(--mm-border) !important;
  border-radius: var(--mm-radius-lg) !important;
  box-shadow: var(--mm-shadow) !important;
}

.mm-content .module input:not([type="checkbox"]):not([type="radio"]),
.mm-content .module select,
.mm-content .module textarea {
  min-height: 40px;
  border-radius: var(--mm-radius);
  border-color: var(--mm-border);
}

/* ─── Modal notificación ─── */
.mm-notify {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mm-notify.hidden {
  display: none;
}

.mm-notify__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.mm-notify__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow-lg);
  padding: var(--mm-space-6) var(--mm-space-5);
  text-align: center;
  animation: mm-notify-in 0.22s var(--mm-ease);
}

@keyframes mm-notify-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.mm-notify__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--mm-space-4);
  border-radius: var(--mm-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.mm-notify__icon--success {
  background: var(--mm-primary-muted);
  color: var(--mm-primary-hover);
}

.mm-notify__icon--error {
  background: var(--mm-danger-bg);
  color: var(--mm-danger);
}

.mm-notify__icon--info {
  background: var(--mm-info-bg);
  color: var(--mm-info);
}

.mm-notify__title {
  font-size: var(--mm-text-subtitle);
  font-weight: 700;
  color: var(--mm-text);
  margin: 0 0 var(--mm-space-2);
}

.mm-notify__message {
  font-size: var(--mm-text-body);
  color: var(--mm-text-secondary);
  margin: 0 0 var(--mm-space-5);
  line-height: 1.5;
}

.mm-shortcuts-list {
  list-style: none;
  margin: 0 0 var(--mm-space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--mm-space-2);
}

.mm-shortcuts-list__row {
  display: grid;
  grid-template-columns: 5.75rem 1fr;
  align-items: center;
  gap: var(--mm-space-3);
  padding: var(--mm-space-2) 0;
  border-bottom: 1px solid var(--mm-border);
}

.mm-shortcuts-list__row:last-child {
  border-bottom: none;
}

.mm-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--mm-text);
  background: var(--mm-bg);
  border: 1px solid var(--mm-border-strong);
  border-radius: var(--mm-radius-sm);
  box-shadow: 0 1px 0 var(--mm-border-strong);
}

.mm-shortcuts-list__desc {
  font-size: var(--mm-text-body);
  color: var(--mm-text-secondary);
  line-height: 1.4;
}

.mm-content .module input:focus,
.mm-content .module select:focus,
.mm-content .module textarea:focus {
  outline: none;
  border-color: var(--mm-primary);
  box-shadow: var(--mm-shadow-focus);
}

/* ─── Animations ─── */
@keyframes mm-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ─── Touch mode ─── */
body.touch-mode .qty-btn,
body.touch-mode .ds-btn--icon {
  width: 52px;
  height: 52px;
  font-size: 22px;
}

body.touch-mode .cart-item {
  padding: var(--mm-space-5);
}

body.touch-mode .catalog-card {
  min-height: 120px;
  padding: var(--mm-space-4);
}

body.touch-mode .ds-btn--cobrar {
  min-height: 72px;
  font-size: 20px;
}

body.touch-mode .mm-sidebar__nav .mod-btn {
  padding: var(--mm-space-4) var(--mm-space-5);
  min-height: 52px;
}

@media (max-width: 640px) {
  .cart-item {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .cart-item__actions {
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
  }
}

/* ─── Calendario turnos programados ─── */
.tp-cal-wrap {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--mm-space-3);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius-lg);
  background: var(--mm-surface);
  height: calc(100vh - 11rem);
  min-height: 420px;
  max-height: calc(100vh - 8.5rem);
}

.tp-cal-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--mm-space-3);
  padding: var(--mm-space-3) var(--mm-space-4);
  border-bottom: 1px solid var(--mm-border);
  background: var(--mm-primary-subtle);
}

.tp-cal-hint {
  flex-shrink: 0;
  margin: 0;
  padding: var(--mm-space-2) var(--mm-space-4);
  font-size: var(--mm-text-help-size);
  color: var(--mm-text-muted);
  border-bottom: 1px solid var(--mm-border);
  background: var(--mm-surface);
}

.tp-cal-scroll {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  min-width: 100%;
}

.tp-cal-hours-side {
  flex: 0 0 52px;
  border-right: 1px solid var(--mm-border);
}

.tp-cal-days-row {
  display: flex;
  flex: 1;
  min-width: 720px;
}

.tp-cal-day-col {
  position: relative;
  flex: 1;
  min-width: 96px;
  border-right: 1px solid var(--mm-border);
}

.tp-cal-day-inner {
  position: relative;
}

.tp-cal-grid {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(88px, 1fr));
  min-width: 720px;
}

.tp-cal-head {
  padding: var(--mm-space-2);
  text-align: center;
  font-size: var(--mm-text-help-size);
  font-weight: 600;
  color: var(--mm-text-secondary);
  border-bottom: 1px solid var(--mm-border);
  background: var(--mm-bg);
}

.tp-cal-head.is-today {
  color: var(--mm-primary-hover);
  background: var(--mm-primary-muted);
}

.tp-cal-hour {
  padding: 0 var(--mm-space-2);
  font-size: 11px;
  color: var(--mm-text-muted);
  text-align: right;
  border-right: 1px solid var(--mm-border);
  border-bottom: 1px solid var(--mm-border);
  height: 40px;
  line-height: 40px;
}

.tp-cal-day {
  position: relative;
  border-right: 1px solid var(--mm-border);
  border-bottom: 1px solid var(--mm-border);
  height: 40px;
  background: var(--mm-surface);
}

.tp-cal-day.is-today {
  background: rgba(22, 163, 74, 0.04);
}

.tp-cal-day-col.is-today {
  background: rgba(22, 163, 74, 0.03);
}

.tp-cal-body {
  display: contents;
}

.tp-cal-events-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tp-cal-event {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.25;
  color: #fff;
  overflow: hidden;
  pointer-events: auto;
  cursor: default;
  box-shadow: var(--mm-shadow-sm);
  z-index: 1;
}

.tp-cal-event--night {
  border: 1px dashed rgba(255, 255, 255, 0.55);
}

.tp-cal-event--draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.tp-cal-event--draggable:active {
  cursor: grabbing;
}

.tp-cal-event--dragging {
  z-index: 20;
  opacity: 0.92;
  box-shadow: var(--mm-shadow-md);
}

.tp-cal-drag-hint {
  float: right;
  opacity: 0.65;
  font-size: 9px;
  margin-left: 2px;
}

.tp-cal-legend {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--mm-space-2);
  padding: var(--mm-space-3) var(--mm-space-4);
  border-top: 1px solid var(--mm-border);
  font-size: var(--mm-text-help-size);
}

.tp-cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tp-cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ─── Focus visible (a11y) ─── */
:focus-visible {
  outline: 2px solid var(--mm-primary);
  outline-offset: 2px;
}

/* ─── AxonPOS (demo / white-label azul) ─── */
.mm-app--axonpos {
  --mm-primary: #2563eb;
  --mm-primary-hover: #1d4ed8;
  --mm-primary-muted: #dbeafe;
  --mm-primary-subtle: #eff6ff;
  --mm-shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body.dark-mode.mm-app--axonpos {
  --mm-primary-muted: #1e3a8a;
  --mm-primary-subtle: #172554;
}

.mm-app--axonpos .mm-sidebar {
  background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 100%);
  border-right-color: rgba(255, 255, 255, 0.12);
}

.mm-app--axonpos .mm-sidebar__brand {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.mm-app--axonpos .mm-sidebar__brand-text h1 {
  color: #ffffff;
}

.mm-app--axonpos .mm-sidebar__brand-text p {
  color: rgba(255, 255, 255, 0.72);
}

.mm-app--axonpos .mm-sidebar__nav .mod-btn {
  color: rgba(255, 255, 255, 0.88);
}

.mm-app--axonpos .mm-sidebar__nav .mod-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.mm-app--axonpos .mm-sidebar__nav .mod-btn.mod-active {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.mm-app--axonpos .ds-btn--primary,
.mm-app--axonpos .ds-btn-primary {
  background: var(--mm-primary);
  border-color: var(--mm-primary);
}

.mm-app--axonpos .ds-btn--primary:hover,
.mm-app--axonpos .ds-btn-primary:hover {
  background: var(--mm-primary-hover);
  border-color: var(--mm-primary-hover);
}

.mm-app--axonpos .ds-plan-banner--info {
  background: var(--mm-primary-subtle);
  border-color: #bfdbfe;
  color: #1e3a8a;
}

body.dark-mode.mm-app--axonpos .ds-plan-banner--info {
  background: #172554;
  border-color: #1e40af;
  color: #bfdbfe;
}
