/* ==========================================================================
   REFACCIONARIA JIMAL - SISTEMA DE DISEÑO OFICIAL
   Taller y refacciones en un solo sistema
   ========================================================================== */

/* Tipografía autoalojada */
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/plus-jakarta-sans-800.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/jetbrains-mono-700.woff2") format("woff2"); }

:root {
  /* Marca */
  --jimal-primary: #DC2626;
  --jimal-primary-hover: #B91C1C;
  --jimal-primary-active: #991B1B;
  --jimal-primary-light: #FEF2F2;
  --jimal-primary-border: #FCA5A5;
  --jimal-primary-ring: rgba(220, 38, 38, 0.12);

  /* Superficies */
  --jimal-canvas: #F8FAFC;
  --jimal-surface: #FFFFFF;
  --jimal-surface-tint: #EFF4FF;      /* surface-container-low: chips de filtro, hover de nav */
  --jimal-border: #E2E8F0;
  --jimal-border-strong: #CBD5E1;

  /* Aliases para compatibilidad */
  --jimal-sidebar-bg: var(--jimal-surface);
  --jimal-border-light: var(--jimal-border);

  /* Texto */
  --jimal-text: #0F172A;
  --jimal-text-muted: #64748B;
  --jimal-text-subtle: #94A3B8;

  /* Semánticos (fondo claro / texto) */
  --jimal-success: #16A34A;  --jimal-success-bg: #DCFCE7;  --jimal-success-text: #15803D;
  --jimal-warning: #D97706;  --jimal-warning-bg: #FEF3C7;  --jimal-warning-text: #B45309;
  --jimal-danger:  #E11D48;  --jimal-danger-bg:  #FFE4E6;  --jimal-danger-text:  #BE123C;
  --jimal-info:    #0284C7;  --jimal-info-bg:    #E0F2FE;  --jimal-info-text:    #0369A1;
  --jimal-neutral-bg: #F1F5F9; --jimal-neutral-text: #475569;

  /* Forma y profundidad */
  --jimal-radius: 8px; --jimal-radius-lg: 14px; --jimal-radius-pill: 9999px;
  --jimal-shadow-1: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --jimal-shadow-2: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --jimal-shadow-3: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

  /* Tipografía */
  --jimal-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --jimal-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --jimal-sidebar-w: 240px; --jimal-topbar-h: 64px; --jimal-ticket-w: 380px;

  /* Sobrescritura Bootstrap */
  --bs-primary: #DC2626; --bs-primary-rgb: 220, 38, 38;
  --bs-body-font-family: var(--jimal-font); --bs-body-bg: var(--jimal-canvas); --bs-body-color: var(--jimal-text);
  --bs-border-color: var(--jimal-border);
}

/* Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--jimal-canvas);
  color: var(--jimal-text);
  font-family: var(--jimal-font);
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--jimal-font-mono);
}

a {
  color: var(--jimal-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--jimal-primary-hover);
}

:focus-visible {
  outline: 2px solid var(--jimal-primary) !important;
  outline-offset: 2px;
}

/* ==========================================================================
   ARQUITECTURA DE LAYOUT (APP SHELL) - STITCH DESIGN SYSTEM
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* Sidebar persistente (≥1024px: 240px, fondo blanco, borde derecho) */
.app-sidebar {
  width: var(--jimal-sidebar-w);
  min-width: var(--jimal-sidebar-w);
  background: var(--jimal-surface);
  border-right: 1px solid var(--jimal-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
  box-shadow: var(--jimal-shadow-1);
}

.sidebar-header {
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--jimal-border);
  flex-shrink: 0;
}

.sidebar-brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.sidebar-brand-img {
  height: 36px;
  width: auto;
  max-width: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-lockup:has(.sidebar-brand-img--solo) {
  width: 100%;
  justify-content: center;
}

.sidebar-brand-img--solo {
  /* El PNG es cuadrado con margen blanco: se recorta al contenido para que el logo ocupe todo el ancho. */
  width: 100%;
  max-width: none;
  height: auto;
  max-height: 180px;
  aspect-ratio: 1.3 / 1;
  object-fit: cover;
  object-position: 50% 51%;
}

.sidebar-brand {
  min-width: 0;
  text-decoration: none;
}

.sidebar-brand-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--jimal-primary-active);
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-subtitle {
  font-family: var(--jimal-font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--jimal-text-muted);
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CTA Nueva orden */
.sidebar-cta-wrap {
  padding: 12px;
  flex-shrink: 0;
}

.sidebar-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--jimal-primary);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--jimal-radius);
  text-decoration: none;
  box-shadow: var(--jimal-shadow-1);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.sidebar-cta-btn:hover {
  background: var(--jimal-primary-hover);
  color: #FFFFFF;
}

.sidebar-cta-btn:active {
  background: var(--jimal-primary-active);
  transform: scale(0.98);
}

/* Navegación por secciones */
.sidebar-nav {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--jimal-primary-hover);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 8px 4px;
  margin: 0;
}

/* Botones del panel lateral: solo existen en móvil */
.sidebar-close,
.topbar-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--jimal-radius-pill);
  background: transparent;
  color: var(--jimal-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-close:hover,
.topbar-menu-toggle:hover { background: var(--jimal-neutral-bg); }
.sidebar-header { position: relative; }
.sidebar-close { position: absolute; top: 8px; right: 8px; }

/* Secciones plegables del menú */
button.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: var(--jimal-radius);
}
button.sidebar-section-title:hover { color: var(--jimal-primary-active); }
.sidebar-section-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
button.sidebar-section-title[aria-expanded="false"] .sidebar-section-chevron { transform: rotate(-90deg); }
.sidebar-group[data-collapsed="true"] { display: none; }
@media (prefers-reduced-motion: reduce) { .sidebar-section-chevron { transition: none; } }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--jimal-radius);
  color: var(--jimal-text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 2;
  color: var(--jimal-text-muted);
  transition: color 0.15s ease;
}

.sidebar-link:hover {
  background: var(--jimal-neutral-bg);
  color: var(--jimal-text);
}

.sidebar-link:hover svg {
  color: var(--jimal-text);
}

.sidebar-link.active,
.sidebar-link[aria-current="page"] {
  background: var(--jimal-surface-tint);
  color: var(--jimal-primary);
  font-weight: 600;
}

.sidebar-link.active svg,
.sidebar-link[aria-current="page"] svg {
  color: var(--jimal-primary);
}

/* Pie de sidebar: Estado de caja */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--jimal-border);
  flex-shrink: 0;
  background: var(--jimal-surface);
}

.sidebar-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--jimal-text-muted);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.sidebar-status-pill:hover {
  background: var(--jimal-neutral-bg);
  color: var(--jimal-text);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator--open {
  background: var(--jimal-success);
  box-shadow: 0 0 0 2px var(--jimal-success-bg);
}

.status-indicator--closed {
  background: var(--jimal-text-subtle);
}

/* Área principal */
.app-main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--jimal-canvas);
}

/* Topbar Header (64px) */
.app-topbar {
  height: var(--jimal-topbar-h);
  background: var(--jimal-surface);
  border-bottom: 1px solid var(--jimal-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 16px;
}

.topbar-brand-mobile,
.topbar-search-toggle {
  display: none;
}

/* Omnibox píldora */
.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-search svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--jimal-text-muted);
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  height: 40px;
  padding: 6px 56px 6px 40px;
  background: var(--jimal-surface-tint);
  border: 1px solid var(--jimal-border);
  border-radius: var(--jimal-radius-pill);
  font-size: 13.5px;
  color: var(--jimal-text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.topbar-search input:focus {
  background: var(--jimal-surface);
  border-color: var(--jimal-primary);
  box-shadow: 0 0 0 3px var(--jimal-primary-ring);
}

.topbar-search .kbd-shortcut {
  position: absolute;
  right: 12px;
  font-family: var(--jimal-font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--jimal-surface);
  color: var(--jimal-text-muted);
  border: 1px solid var(--jimal-border);
  border-radius: 4px;
  cursor: pointer;
}

.topbar-search input::placeholder { color: var(--jimal-text-muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Campana de alertas */
.notif-bell-btn {
  background: none;
  border: none;
  color: var(--jimal-text-muted);
  position: relative;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.notif-bell-btn:hover {
  background: var(--jimal-neutral-bg);
  color: var(--jimal-text);
}

.notif-bell-btn .notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--jimal-primary);
  border-radius: 50%;
  border: 2px solid var(--jimal-surface);
}

.notif-bell-btn:disabled { cursor: default; }

/* Menú de usuario con <details> accesible */
.user-dropdown {
  position: relative;
  display: inline-block;
}

.user-dropdown summary {
  list-style: none;
  cursor: pointer;
}

.user-dropdown summary::-webkit-details-marker {
  display: none;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: var(--jimal-radius);
  transition: background-color 0.15s ease;
}

.user-profile-badge:hover {
  background: var(--jimal-neutral-bg);
}

.user-avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--jimal-surface-tint);
  color: var(--jimal-primary);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--jimal-primary-border);
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: left;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--jimal-text);
}

.user-role {
  font-size: 11.5px;
  color: var(--jimal-text-muted);
}

.dropdown-chevron {
  width: 16px;
  height: 16px;
  color: var(--jimal-text-muted);
}

.user-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--jimal-surface);
  border: 1px solid var(--jimal-border);
  border-radius: var(--jimal-radius);
  box-shadow: var(--jimal-shadow-2);
  min-width: 210px;
  padding: 6px;
  z-index: 200;
}

.dropdown-user-info {
  padding: 8px 10px;
  border-bottom: 1px solid var(--jimal-border);
  margin-bottom: 4px;
}

.dropdown-user-username {
  font-size: 12px;
  color: var(--jimal-text-muted);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--jimal-text);
  border-radius: 6px;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background: var(--jimal-neutral-bg);
}

.dropdown-item--logout {
  color: var(--jimal-danger);
}

.dropdown-item--logout:hover {
  background: var(--jimal-danger-bg);
}

/* Canvas del contenido principal */
.app-main {
  flex: 1;
  padding: 24px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* Tablet Rail Layout (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-sidebar {
    width: 64px;
    min-width: 64px;
  }

  .sidebar-header {
    justify-content: center;
    padding: 12px 8px;
  }

  .sidebar-brand-img--solo {
    width: 48px;
    height: 44px;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .sidebar-group[data-collapsed="true"] { display: block; }

  .sidebar-brand-title,
  .sidebar-brand-subtitle,
  .sidebar-section-title,
  .sidebar-link span,
  .sidebar-cta-btn span,
  .sidebar-status-pill span:not(.status-indicator) {
    display: none;
  }

  .sidebar-cta-wrap {
    padding: 8px;
  }

  .sidebar-cta-btn {
    padding: 8px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    margin: 0 auto;
  }

  .sidebar-nav { gap: 0; }

  .sidebar-link {
    min-height: 44px;
    justify-content: center;
    padding: 10px 0;
  }

  .sidebar-footer {
    padding: 8px;
    display: flex;
    justify-content: center;
  }

  .sidebar-status-pill {
    padding: 8px;
  }
}

/* Mobile Shell (<768px) */
@media (max-width: 767px) {
  /* La barra lateral se despliega como panel sobre el contenido (reemplaza la barra inferior). */
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 1100;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
    box-shadow: var(--jimal-shadow-3);
    overflow-y: auto;
  }
  body.sidebar-open .app-sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.2s ease;
  }
  body.sidebar-open { overflow: hidden; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(15, 23, 42, 0.45);
  }
  .sidebar-backdrop[hidden] { display: none; }
  .sidebar-close,
  .topbar-menu-toggle {
    display: inline-flex;
  }
  .sidebar-link { min-height: 44px; }

  .app-topbar {
    height: 56px;
    padding: 0 16px;
  }

  .topbar-brand-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
  }

  .topbar-brand-mobile img {
    /* El PNG tiene margen blanco: se recorta al contenido para que el logo se lea en la barra. */
    height: 40px;
    width: auto;
    aspect-ratio: 1.3 / 1;
    object-fit: cover;
    object-position: 50% 51%;
    max-width: none;
  }

  .topbar-brand-mobile { margin-right: auto; min-width: 44px; min-height: 44px; }

  .topbar-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--jimal-radius-pill);
    background: transparent;
    color: var(--jimal-text-muted);
  }

  .topbar-search-toggle svg { width: 20px; height: 20px; }
  .topbar-right { gap: 8px; }
  .notif-bell-btn { display: none; }

  .topbar-search {
    display: none;
    max-width: none;
    position: absolute;
    inset: 56px 0 auto;
    padding: 8px 16px;
    background: var(--jimal-surface);
    border-bottom: 1px solid var(--jimal-border);
  }

  .search-open .topbar-search { display: flex; }
  .search-open .topbar-search svg { left: 28px; }
  .search-open .topbar-search input { height: 44px; }

  .topbar-search input {
    height: 36px;
    padding: 4px 12px 4px 34px;
    font-size: 13px;
  }

  .topbar-search svg {
    left: 10px;
    width: 16px;
    height: 16px;
  }

  .topbar-search .kbd-shortcut {
    display: none;
  }

  .user-meta,
  .dropdown-chevron {
    display: none;
  }

  .user-profile-badge {
    padding: 0;
  }

  .app-main {
    padding: 16px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar { transition: none !important; }
}

.app-footer {
  padding: 16px;
  text-align: center;
  color: var(--jimal-text-muted);
  font-size: 12px;
  border-top: 1px solid var(--jimal-border);
}

.app-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.app-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--jimal-text);
  letter-spacing: -0.02em;
}

.app-page-subtitle {
  font-size: 0.875rem;
  color: var(--jimal-text-muted);
  margin-top: 0.2rem;
}

/* ==========================================================================
   BOTONES Y CONTROLES UI
   ========================================================================== */

.btn {
  height: 40px;
  min-height: 40px;
  padding: 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--jimal-primary);
  border-color: var(--jimal-primary);
  color: #FFFFFF;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--jimal-primary-hover);
  border-color: var(--jimal-primary-hover);
  color: #FFFFFF;
}

.btn-outline-primary {
  background-color: #FFFFFF;
  border-color: var(--jimal-primary);
  color: var(--jimal-primary);
}

.btn-outline-primary:hover {
  background-color: var(--jimal-primary-light);
  border-color: var(--jimal-primary);
  color: var(--jimal-primary);
}

.btn-outline-secondary {
  background-color: #FFFFFF;
  border-color: #D1D5DB;
  color: #374151;
}

.btn-outline-secondary:hover {
  background-color: #F8FAFC;
  border-color: #9CA3AF;
  color: #111827;
}

.btn-success {
  background-color: #10B981;
  border-color: #10B981;
  color: #FFFFFF;
}

.btn-success:hover {
  background-color: #059669;
  border-color: #059669;
}

.btn-sm {
  height: 32px;
  min-height: 32px;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  border-radius: 6px;
}

.btn-icon-action {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid var(--jimal-border);
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-action:hover {
  background: #F8FAFC;
  color: var(--jimal-text);
  border-color: #CBD5E1;
}

/* ==========================================================================
   INPUTS Y FORMULARIOS
   ========================================================================== */

.form-control, .form-select {
  height: 42px;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  background-color: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  color: var(--jimal-text);
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--jimal-primary);
  box-shadow: 0 0 0 3px rgba(229, 37, 42, 0.12);
  outline: none;
}

.form-control::placeholder {
  color: #94A3B8;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

.form-text {
  font-size: 0.8rem;
  color: var(--jimal-text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.form-check-input {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  border-radius: 4px;
  border: 1.5px solid #CBD5E1;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--jimal-primary);
  border-color: var(--jimal-primary);
}

/* ==========================================================================
   COMPONENTES - CONTRATO STITCH (INTERFAZ AUTENTICADA)
   ========================================================================== */

:root {
  --jimal-text-secondary: #334155;
  --jimal-on-primary: var(--jimal-surface);
  --jimal-radius-sm: 6px;
  --jimal-control-h: 40px;
  --jimal-touch-h: 44px;
  --jimal-motion-fast: 150ms;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-header > div { min-width: 0; }
.page-header__title {
  margin: 0;
  color: var(--jimal-text);
  font-size: 30px;
  font-weight: 700;
  line-height: 38px;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.page-header__subtitle { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--jimal-text-muted); }
.page-header__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }

/* Shared names are scoped so legacy module rules and login retain their own API. */
.app-shell .btn {
  min-height: var(--jimal-control-h);
  height: auto;
  padding: 8px 16px;
  font-family: var(--jimal-font);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  border-radius: var(--jimal-radius);
  transition: color var(--jimal-motion-fast) ease, background-color var(--jimal-motion-fast) ease, border-color var(--jimal-motion-fast) ease, box-shadow var(--jimal-motion-fast) ease;
}
.app-shell .btn-primary {
  background: var(--jimal-primary);
  border-color: var(--jimal-primary);
  color: var(--jimal-on-primary);
  box-shadow: var(--jimal-shadow-1);
}
.app-shell .btn-primary:hover { background: var(--jimal-primary-hover); border-color: var(--jimal-primary-hover); color: var(--jimal-on-primary); }
.app-shell .btn-primary:active { background: var(--jimal-primary-active); border-color: var(--jimal-primary-active); }
.btn-secondary-neutral { background: var(--jimal-surface); border: 1px solid var(--jimal-border); color: var(--jimal-text-secondary); }
.btn-secondary-neutral:hover { background: var(--jimal-neutral-bg); border-color: var(--jimal-border-strong); color: var(--jimal-text-secondary); }
.btn-ghost { background: transparent; border: 0; color: var(--jimal-text-muted); }
.btn-ghost:hover { background: var(--jimal-neutral-bg); color: var(--jimal-text); }
.app-shell .btn-icon { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; flex-shrink: 0; }
.app-shell .btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.app-shell .btn:disabled, .app-shell .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.app-shell .btn:focus-visible,
.chip-filter:focus-visible,
.table-pagination__button:focus-visible,
.tabs__tab:focus-visible,
.pill-tabs__tab:focus-visible,
.card--interactive:focus-visible {
  border-color: var(--jimal-primary);
  box-shadow: 0 0 0 3px var(--jimal-primary-ring);
}

.app-shell .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--jimal-radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  white-space: nowrap;
  vertical-align: middle;
}
.chip--success { background: var(--jimal-success-bg); color: var(--jimal-success-text); }
.chip--warning { background: var(--jimal-warning-bg); color: var(--jimal-warning-text); }
.chip--danger { background: var(--jimal-danger-bg); color: var(--jimal-danger-text); }
.chip--info { background: var(--jimal-info-bg); color: var(--jimal-info-text); }
.chip--neutral { background: var(--jimal-neutral-bg); color: var(--jimal-neutral-text); }
.chip__dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: var(--jimal-radius-pill); background: currentColor; }
.chip-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--jimal-control-h);
  padding: 8px 14px;
  border: 1px solid var(--jimal-border);
  border-radius: var(--jimal-radius-pill);
  font: 600 12px/18px var(--jimal-font);
  background: var(--jimal-surface);
  color: var(--jimal-neutral-text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--jimal-motion-fast) ease, border-color var(--jimal-motion-fast) ease, color var(--jimal-motion-fast) ease;
}
.chip-filter:hover { background: var(--jimal-neutral-bg); color: var(--jimal-text); }
.chip-filter.active, .chip-filter[aria-pressed="true"], .chip-filter[aria-current="page"] { background: var(--jimal-primary); border-color: var(--jimal-primary); color: var(--jimal-on-primary); }
.chip-filter__count { font-variant-numeric: tabular-nums; font-size: 11px; }
.chip-filter:disabled { opacity: 0.55; cursor: not-allowed; }

.app-shell .card, .app-shell .kpi-card {
  min-width: 0;
  background: var(--jimal-surface);
  color: var(--jimal-text);
  border: 1px solid var(--jimal-border);
  border-radius: var(--jimal-radius-lg);
  box-shadow: var(--jimal-shadow-1);
}
.card--interactive { text-decoration: none; transition: border-color var(--jimal-motion-fast) ease, box-shadow var(--jimal-motion-fast) ease; }
.card--interactive:hover { border-color: var(--jimal-border-strong); box-shadow: var(--jimal-shadow-2); color: var(--jimal-text); }
.app-shell .kpi-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.app-shell .kpi-card:hover { transform: none; box-shadow: var(--jimal-shadow-1); }
.kpi-card__header { display: flex; align-items: center; gap: 12px; }
.kpi-card__icon, .quick-action__icon, .empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--jimal-radius);
  background: var(--jimal-primary-light);
  color: var(--jimal-primary);
}
.kpi-card__icon svg, .quick-action__icon svg, .empty-state__icon svg { width: 24px; height: 24px; }
.kpi-card__icon--success, .quick-action__icon--success { background: var(--jimal-success-bg); color: var(--jimal-success-text); }
.kpi-card__icon--warning, .quick-action__icon--warning { background: var(--jimal-warning-bg); color: var(--jimal-warning-text); }
.kpi-card__icon--info, .quick-action__icon--info { background: var(--jimal-info-bg); color: var(--jimal-info-text); }
.kpi-card__label { font-size: 12px; line-height: 18px; color: var(--jimal-text-muted); }
.kpi-card__value { font-size: 30px; font-weight: 700; line-height: 38px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-card__footer { margin: 0; font-size: 12px; line-height: 18px; color: var(--jimal-text-muted); }
.kpi-card__trend { font-weight: 600; }
.kpi-card__trend--up { color: var(--jimal-success-text); }
.kpi-card__trend--down { color: var(--jimal-danger-text); }
.quick-action { display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: 84px; padding: 20px; }
.quick-action__copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.quick-action__title { font-size: 14px; font-weight: 600; line-height: 20px; color: var(--jimal-text); }
.quick-action__subtitle { font-size: 12px; line-height: 18px; color: var(--jimal-text-muted); }

.data-table-wrapper { max-width: 100%; overflow-x: auto; border-radius: var(--jimal-radius-lg) var(--jimal-radius-lg) 0 0; }
.data-table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 13px; line-height: 20px; }
.data-table th { background: var(--jimal-canvas); color: var(--jimal-text-muted); font-size: 11px; font-weight: 700; line-height: 16px; text-transform: uppercase; letter-spacing: 0.02em; text-align: left; }
.data-table th, .data-table td { height: 50px; padding: 12px 16px; border-bottom: 1px solid var(--jimal-border); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--jimal-canvas); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .data-table__number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .data-table__actions { text-align: center; white-space: nowrap; }
.table-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--jimal-border); color: var(--jimal-text-muted); font-size: 12px; line-height: 18px; }
.table-pagination { display: flex; align-items: center; gap: 4px; }
.table-pagination__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--jimal-border);
  border-radius: var(--jimal-radius);
  background: var(--jimal-surface);
  color: var(--jimal-neutral-text);
  font: 600 12px/18px var(--jimal-font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--jimal-motion-fast) ease, color var(--jimal-motion-fast) ease;
}
.table-pagination__button:hover { background: var(--jimal-neutral-bg); color: var(--jimal-text); }
.table-pagination__button.active, .table-pagination__button[aria-current="page"] { background: var(--jimal-primary); border-color: var(--jimal-primary); color: var(--jimal-on-primary); }
.table-pagination__button:disabled { opacity: 0.55; cursor: not-allowed; }
.table-pagination__button svg { width: 16px; height: 16px; }
.mono-badge { display: inline-flex; padding: 3px 8px; background: var(--jimal-surface-tint); border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius-sm); color: var(--jimal-text-secondary); font: 500 13px/18px var(--jimal-font-mono); white-space: nowrap; }

.search-field { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 42px; padding: 0 12px; background: var(--jimal-surface); border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius); transition: border-color var(--jimal-motion-fast) ease, box-shadow var(--jimal-motion-fast) ease; }
.search-field > svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--jimal-text-muted); }
.search-pill { border-radius: var(--jimal-radius-pill); }
.search-field > input, .app-shell .search-field > .form-control { width: 100%; min-width: 0; height: 40px; min-height: 40px; padding: 8px 0; border: 0; border-radius: inherit; background: transparent; color: var(--jimal-text); font: 400 14px/20px var(--jimal-font); }
.search-field:focus-within { border-color: var(--jimal-primary); box-shadow: 0 0 0 3px var(--jimal-primary-ring); }
.app-shell .search-field > input:focus, .app-shell .search-field > input:focus-visible { box-shadow: none; outline: none !important; }
.search-field input::placeholder { color: var(--jimal-text-muted); opacity: 1; }

.tabs { display: flex; gap: 20px; max-width: 100%; overflow-x: auto; border-bottom: 1px solid var(--jimal-border); }
.tabs__tab { display: inline-flex; align-items: center; justify-content: center; min-height: var(--jimal-control-h); padding: 8px 4px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--jimal-text-muted); font: 600 14px/20px var(--jimal-font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: color var(--jimal-motion-fast) ease, border-color var(--jimal-motion-fast) ease; }
.tabs__tab:hover { color: var(--jimal-text); }
.tabs__tab.active, .tabs__tab[aria-current="page"], .tabs__tab[aria-selected="true"] { color: var(--jimal-primary); border-bottom-color: var(--jimal-primary); }
.pill-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--jimal-neutral-bg); border-radius: var(--jimal-radius-pill); }
.pill-tabs__tab { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 14px; border: 0; border-radius: var(--jimal-radius-pill); background: transparent; color: var(--jimal-neutral-text); font: 600 12px/18px var(--jimal-font); text-decoration: none; cursor: pointer; transition: background-color var(--jimal-motion-fast) ease, color var(--jimal-motion-fast) ease; }
.pill-tabs__tab:hover { color: var(--jimal-text); background: var(--jimal-surface); }
.pill-tabs__tab.active, .pill-tabs__tab[aria-pressed="true"], .pill-tabs__tab[aria-selected="true"] { color: var(--jimal-primary); background: var(--jimal-surface); box-shadow: var(--jimal-shadow-1); }
.tabs__tab:disabled, .pill-tabs__tab:disabled { opacity: 0.55; cursor: not-allowed; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 20px; text-align: center; }
.empty-state__icon { background: var(--jimal-neutral-bg); color: var(--jimal-text-muted); }
.empty-state__title { margin: 0; font-size: 16px; font-weight: 600; line-height: 24px; color: var(--jimal-text); }
.empty-state__text { max-width: 48ch; margin: 0; font-size: 14px; line-height: 20px; color: var(--jimal-text-muted); }
.empty-state > .btn { margin-top: 4px; }

/* Bootstrap compatibility. Status labels in new views use .chip, not .badge. */
.app-shell .form-control, .app-shell .form-select { min-width: 0; min-height: 42px; padding: 8px 12px; border-color: var(--jimal-border); border-radius: var(--jimal-radius); background-color: var(--jimal-surface); color: var(--jimal-text); font-family: var(--jimal-font); caret-color: var(--jimal-primary); transition: border-color var(--jimal-motion-fast) ease, box-shadow var(--jimal-motion-fast) ease; }
.app-shell textarea.form-control { height: auto; min-height: 96px; }
.app-shell .form-select { padding-right: 36px; }
.app-shell .form-control::placeholder { color: var(--jimal-text-muted); opacity: 1; }
.app-shell .form-label { color: var(--jimal-text-secondary); }
.app-shell .form-control:focus, .app-shell .form-select:focus, .app-shell .form-check-input:focus { border-color: var(--jimal-primary); box-shadow: 0 0 0 3px var(--jimal-primary-ring); }
.app-shell .form-control:disabled, .app-shell .form-select:disabled { background-color: var(--jimal-neutral-bg); color: var(--jimal-text-muted); cursor: not-allowed; }
.app-shell .form-control.is-invalid, .app-shell .form-select.is-invalid { border-color: var(--jimal-danger-text); }
.app-shell .invalid-feedback { color: var(--jimal-danger-text); }
.app-shell .form-check-input { border-color: var(--jimal-border-strong); }
.app-shell .form-check-input:checked { background-color: var(--jimal-primary); border-color: var(--jimal-primary); }
.app-shell .form-check-input[type="checkbox"] + .form-check-label { display: inline-flex; align-items: center; min-width: var(--jimal-touch-h); min-height: var(--jimal-touch-h); padding: 8px; cursor: pointer; }
.app-shell .form-check .form-check-input[type="checkbox"] { margin-top: 13px; }
.app-shell .form-check-input[type="checkbox"]:disabled + .form-check-label { cursor: not-allowed; }
.app-shell .alert { border-radius: var(--jimal-radius); border: 1px solid currentColor; font-size: 14px; line-height: 20px; }
.app-shell .alert-success { background: var(--jimal-success-bg); color: var(--jimal-success-text); }
.app-shell .alert-warning { background: var(--jimal-warning-bg); color: var(--jimal-warning-text); }
.app-shell .alert-danger { background: var(--jimal-danger-bg); color: var(--jimal-danger-text); }
.app-shell .alert-info { background: var(--jimal-info-bg); color: var(--jimal-info-text); }
.app-shell .alert-secondary, .app-shell .alert-light { background: var(--jimal-neutral-bg); color: var(--jimal-neutral-text); }
.app-shell .alert .alert-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.app-shell .badge { --bs-badge-color: var(--jimal-neutral-text); font-family: var(--jimal-font); font-weight: 600; border-radius: var(--jimal-radius-pill); }

@media (max-width: 767px) {
  .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-header__title { font-size: 22px; line-height: 28px; }
  .page-header__actions { width: 100%; }
  .search-field { width: 100%; }
}
@media (max-width: 767px), (pointer: coarse) {
  .app-shell .btn, .chip-filter, .tabs__tab, .pill-tabs__tab, .table-pagination__button { min-height: var(--jimal-touch-h); }
  .app-shell .btn-icon, .table-pagination__button { min-width: var(--jimal-touch-h); }
  .app-shell .btn-icon { width: var(--jimal-touch-h); height: var(--jimal-touch-h); }
  .app-shell .form-control, .app-shell .form-select { min-height: var(--jimal-touch-h); }
  .search-field { min-height: var(--jimal-touch-h); }
  .app-shell .search-field > input { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell .btn, .chip-filter, .card--interactive, .app-shell .kpi-card, .table-pagination__button, .search-field, .tabs__tab, .pill-tabs__tab, .app-shell .form-control, .app-shell .form-select { animation: none; transition: none; }
}

/* ==========================================================================
   KPI TILES Y DASHBOARD
   ========================================================================== */

.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--jimal-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.05);
}

/* Accesos Rápidos (Quick Action Tiles) */

/* Dashboard 2 Columnas Centrales */

/* ==========================================================================
   TABS Y FILTROS
   ========================================================================== */

/* Chips de Categorías (Píldoras) */

/* ==========================================================================
   CHIPS Y BADGES DE ESTADO (SEMÁNTICA)
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.chip-proceso, .chip-recibida, .chip-en_reparacion {
  background: #EFF6FF;
  color: #1D4ED8;
}

.chip-diagnostico, .chip-en_diagnostico, .chip-espera, .chip-en_espera, .chip-pendiente_cliente, .chip-pendiente_autorizacion {
  background: #FFFBEB;
  color: #B45309;
}

.chip-lista, .chip-lista_entrega, .chip-entregada, .chip-completada, .chip-confirmada, .chip-vigente {
  background: #ECFDF5;
  color: #047857;
}

.chip-warn, .chip-alerta, .chip-stock_bajo, .chip-no_reparada, .chip-cancelada, .chip-rechazada {
  background: #FEF2F2;
  color: #B91C1C;
}

.chip-pruebas, .chip-en_pruebas {
  background: #FAF5FF;
  color: #6D28D9;
}

/* ==========================================================================
   TARJETAS DE ÓRDENES (ORDER CARDS)
   ========================================================================== */

/* ==========================================================================
   TABLAS MODERNAS
   ========================================================================== */

.table-modern-wrapper {
  background: #FFFFFF;
  border: 1px solid var(--jimal-border);
  border-radius: 12px;
  overflow: hidden;
}

.table-modern {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
}

.table-modern th {
  background: #F8FAFC;
  color: #64748B;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--jimal-border);
  vertical-align: middle;
}

.table-modern td {
  padding: 0.9rem 1rem;
  font-size: 0.875rem;
  color: var(--jimal-text);
  border-bottom: 1px solid var(--jimal-border);
  vertical-align: middle;
}

.table-modern tr:last-child td {
  border-bottom: none;
}

.table-modern tbody tr:hover {
  background-color: #F8FAFC;
}

/* ==========================================================================
   PUNTO DE VENTA (POS)
   ========================================================================== */

/* ==========================================================================
   AGENDA Y CALENDARIO SEMANAL
   ========================================================================== */

/* ==========================================================================
   PORTAL PÚBLICO DE AUTORIZACIÓN (COTIZACIONES CLIENTE)
   ========================================================================== */

/* ==========================================================================
   LOGIN SCREEN (SPLIT DESIGN)
   ========================================================================== */

.login-split-wrapper {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.login-hero-side {
  flex: 1.2;
  background-color: #0F172A;
  background-image: url('../images/workshop-bg.svg');
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4rem 3.5rem;
  color: #FFFFFF;
}

.login-hero-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.3) 0%, rgba(15, 23, 42, 0.85) 100%);
  z-index: 1;
}

.login-hero-content {
  position: relative;
  z-index: 2;
  max-width: 520px;
}

.login-hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.login-pill-tags {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.login-pill-tag {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  padding: 0.4rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #FFFFFF;
}

.login-form-side {
  flex: 1;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

@media (max-width: 768px) {

  .form-grid {
    grid-template-columns: 1fr;
  }

  .login-hero-side {
    display: none;
  }
}

/* Login: split photo and access card from the approved reference. */
.skip-link {
  position: fixed;
  z-index: 2000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  background: #FFFFFF;
  color: #B91C1C;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.login-split-wrapper {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: grid;
  grid-template-columns: minmax(0, 49fr) minmax(0, 51fr);
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #101315;
  position: relative;
}

.login-split-wrapper::before,
.login-split-wrapper::after {
  position: absolute;
  inset: 0;
  content: "";
  background: url('../images/login-workshop.png') no-repeat;
}

/* Fondo difuminado que rellena el ancho sobrante */
.login-split-wrapper::after {
  background-position: center;
  background-size: cover;
  filter: blur(14px) brightness(0.45);
  transform: scale(1.06);
}

/* Foto nítida a altura completa, anclada a la izquierda: la moto queda pequeña y el taller se aprecia */
.login-split-wrapper::before {
  z-index: 1;
  right: auto;
  left: -4%;
  width: auto;
  aspect-ratio: 1122 / 1402;
  background-position: left center;
  background-size: 100% 100%;
  -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
}

.login-hero-side,
.login-form-side {
  z-index: 2;
}

.login-hero-side {
  position: relative;
  isolation: isolate;
  display: flex;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  align-items: flex-end;
  padding: clamp(1.5rem, 4vw, 3.75rem);
  color: #FFFFFF;
  background: transparent;
}

.login-hero-side::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 12, 14, 0.12) 30%, rgba(9, 12, 14, 0.82) 100%);
  content: "";
}

.login-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 36rem;
}

.login-hero-title {
  margin: 0 0 clamp(0.7rem, 2vh, 1rem);
  color: #FFFFFF;
  font-size: clamp(1.8rem, 3.2vw, 2.9rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.login-pill-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: clamp(0.45rem, 0.9vw, 0.85rem);
}

.login-pill-tag {
  display: flex;
  width: clamp(5.25rem, 8.4vw, 8rem);
  min-height: clamp(6.5rem, 12vh, 8.25rem);
  flex: 0 1 8rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.8rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.9rem;
  background: rgba(13, 17, 20, 0.78);
  color: #FFFFFF;
  font-size: clamp(0.85rem, 1.1vw, 1.15rem);
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
}

.login-pill-tag svg {
  display: block;
  width: clamp(1.5rem, 2.1vw, 2rem);
  height: clamp(1.5rem, 2.1vw, 2rem);
  flex: none;
}

.login-form-side {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  align-items: center;
  justify-content: center;
  padding: clamp(4.5rem, 6vw, 5.5rem) clamp(1rem, 2.2vw, 2rem) clamp(2rem, 3vw, 3.5rem) 0;
  background: transparent;
}

.login-form-side::before {
  position: absolute;
  z-index: 0;
  inset: -6px;
  background: linear-gradient(90deg, rgba(9, 12, 14, 0.2), rgba(9, 12, 14, 0.72));
  content: "";
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 44rem);
  max-width: 44rem;
  padding: clamp(4rem, 5.5vw, 5.5rem) clamp(2rem, 4vw, 3.5rem) clamp(3rem, 4vw, 4rem);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: #FFFFFF;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
}

.login-attribution {
  position: relative;
  z-index: 1;
  margin-top: clamp(0.75rem, 2.5vh, 1.25rem);
  font-size: 0.75rem;
  color: #FFFFFF;
  text-align: center;
  line-height: 1.4;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
}

.login-card-header {
  margin-bottom: 2.5rem;
  text-align: left;
}

.login-wordmark {
  display: block;
  width: min(100%, 20rem);
  height: auto;
  aspect-ratio: 1.3 / 1;
  object-fit: cover;
  object-position: 50% 51%;
  margin: 0 auto 2rem;
}

.login-card-header h2 {
  margin: 0 0 0.55rem;
  color: #111820;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.login-card-header p {
  margin: 0;
  color: #526174;
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  line-height: 1.4;
}

.login-card .mb-3 {
  margin-bottom: 1.4rem !important;
}

.login-card .form-label {
  display: block;
  margin-bottom: 0.45rem;
  color: #17212D;
  font-size: 1.35rem;
  font-weight: 600;
}

.login-card .form-control {
  min-height: 4.2rem;
  height: 4.2rem;
  padding: 0.75rem 1rem 0.75rem 4.5rem;
  border: 1.5px solid #D7DEE7;
  border-radius: 0.75rem;
  background: #FFFFFF;
  color: #17212D;
  font-size: 1.2rem;
  box-shadow: none;
}

.login-card .form-control::placeholder {
  color: #77869A;
  opacity: 1;
}

.login-input-wrap,
.login-password-wrap {
  position: relative;
}

.login-field-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 1.25rem;
  width: 1.55rem;
  height: 1.55rem;
  transform: translateY(-50%);
  color: #64748B;
  pointer-events: none;
}

.login-card .form-control:focus {
  border-color: #E5252A;
  box-shadow: 0 0 0 3px rgba(229, 37, 42, 0.14);
}

.login-password-wrap {
  position: relative;
}

.login-card .login-password-input {
  padding-right: 4rem;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: #64748B;
  cursor: pointer;
}

.login-password-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

.login-password-toggle[aria-pressed="false"] .login-password-icon-visible,
.login-password-toggle[aria-pressed="true"] .login-password-icon-hidden {
  display: none;
}

.login-password-toggle:hover {
  background: #F1F3F5;
  color: #263445;
}

.login-options {
  min-height: 2.5rem;
  margin: 0.2rem 0 2rem;
  gap: 0.75rem;
  color: #405066;
  font-size: 1.15rem;
}

.login-options .form-check {
  min-height: 1.6rem;
  margin: 0;
  padding-left: 1.9rem;
}

.login-options .form-check-input {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.1rem 0 0 -1.9rem;
  border-color: #8290A0;
  accent-color: #E5252A;
}

.login-options .form-check-label {
  color: #405066;
  line-height: 1.25;
  padding-left: 0.25rem;
}

.login-forgot-link {
  color: #405066;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.login-forgot-link:hover {
  color: #A8181C;
}

.login-error {
  margin-bottom: 0.85rem;
  border-radius: 0.45rem;
  font-size: 0.82rem;
}

.login-card .login-submit {
  min-height: 5.1rem;
  height: 5.1rem;
  border: 1px solid #EF2026;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #FF2A2E, #E8161B);
  color: #FFFFFF;
  font-size: 1.5rem;
  font-weight: 700;
  gap: 1rem;
  box-shadow: 0 10px 24px rgba(239, 32, 38, 0.32);
}

.login-card .login-submit:hover,
.login-card .login-submit:focus-visible {
  border-color: #C9181E;
  background: #C9181E;
  box-shadow: 0 6px 16px rgba(201, 24, 30, 0.38);
}

@media (max-width: 900px) and (orientation: portrait) {
  .login-split-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    justify-content: center;
    background: #F1F3F5;
    overflow-y: auto;
  }

  .login-hero-side {
    display: none;
  }

  .login-form-side {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    padding: 1.25rem;
    overflow-y: auto;
  }

  .login-card {
    width: min(100%, 27rem);
    padding: clamp(1.5rem, 6vw, 2rem);
  }

  .login-card-header {
    margin-bottom: 1.5rem;
  }

  .login-wordmark {
    width: min(100%, 19rem);
    margin-bottom: 1.5rem;
  }

  .login-card-header h2 {
    font-size: 1.8rem;
  }

  .login-card-header p {
    font-size: 1rem;
  }

  .login-card .form-label {
    font-size: 1rem;
  }

  .login-card .form-control {
    min-height: 3.6rem;
    height: 3.6rem;
    padding-left: 3.5rem;
    font-size: 1rem;
  }

  .login-field-icon {
    left: 1rem;
    width: 1.25rem;
    height: 1.25rem;
  }

  .login-options {
    font-size: 0.9rem;
  }

  .login-card .login-submit {
    min-height: 4.2rem;
    height: 4.2rem;
    font-size: 1.2rem;
  }

  .login-attribution {
    margin-top: clamp(0.75rem, 2vh, 1.25rem);
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .login-split-wrapper {
    grid-template-columns: minmax(0, 48fr) minmax(0, 52fr);
    min-height: 100vh;
    min-height: 100svh;
    overflow: auto;
  }

  .login-hero-side {
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    padding: 0.5rem;
    background-position: 12% center;
  }

  .login-hero-title {
    margin-bottom: 0.45rem;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  }

  .login-hero-content {
    transform: translateY(-1.75rem);
  }

  .login-pill-tag {
    min-height: clamp(2.8rem, 6vh, 3rem);
  }

  .login-form-side {
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(0.35rem, 1.8vh, 0.65rem) 0.5rem clamp(0.25rem, 1.2vh, 0.45rem) 0;
  }

  .login-card {
    width: 100%;
    max-width: 27rem;
    padding: clamp(0.45rem, 1.6vh, 0.65rem) 1.125rem;
    border-radius: 0.5rem;
  }

  .login-card-header {
    margin-bottom: 0.35rem;
  }

  .login-wordmark {
    width: clamp(4.5rem, 16vw, 5.5rem);
    height: clamp(3rem, 9.5vh, 3.8rem);
    margin-bottom: 0.15rem;
  }

  .login-field-icon {
    left: 0.6rem;
    width: 0.95rem;
    height: 0.95rem;
  }

  .login-card-header h2 {
    font-size: clamp(0.9rem, 3.2vw, 1.15rem);
  }

  .login-card-header p {
    font-size: clamp(0.6rem, 1.8vw, 0.72rem);
  }

  .login-card .mb-3 {
    margin-bottom: 0.35rem !important;
  }

  .login-card .form-label {
    margin-bottom: 0.1rem;
    font-size: clamp(0.6rem, 1.5vw, 0.68rem);
  }

  .login-card .form-control {
    min-height: clamp(1.4rem, 6.2vh, 1.85rem);
    height: clamp(1.4rem, 6.2vh, 1.85rem);
    padding: 0.2rem 0.5rem 0.2rem 1.9rem;
    font-size: clamp(0.6rem, 1.4vw, 0.7rem);
  }

  .login-card .login-password-input {
    padding-right: 2rem;
  }

  .login-password-toggle {
    right: 0.3rem;
    width: 1.4rem;
    height: 1.4rem;
  }

  .login-password-toggle svg {
    width: 0.85rem;
    height: 0.85rem;
  }

  .login-options {
    margin: 0.1rem 0 0.25rem !important;
    font-size: clamp(0.5rem, 1.4vw, 0.6rem);
  }

  .login-card .login-submit {
    min-height: clamp(1.5rem, 7vh, 2rem);
    height: clamp(1.5rem, 7vh, 2rem);
    font-size: clamp(0.6rem, 1.4vw, 0.7rem);
  }

  .login-attribution {
    margin-top: clamp(0.25rem, 1.2vh, 0.45rem);
    font-size: clamp(0.58rem, 1.5vw, 0.68rem);
    line-height: 1.2;
  }
}

@media (max-width: 400px) and (orientation: landscape) {
  .login-split-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-hero-side {
    display: none;
  }

  .login-form-side {
    width: 100%;
    grid-column: 1 / -1;
  }
}

@media (max-height: 820px) and (min-width: 901px) {
  .login-form-side {
    padding: 0.65rem clamp(1rem, 2.2vw, 1.5rem);
  }

  .login-card {
    padding: 1.4rem 2rem 1.3rem;
  }

  .login-card-header {
    margin-bottom: 0.9rem;
  }

  .login-wordmark {
    width: min(100%, 19rem);
    margin-bottom: 0.8rem;
  }

  .login-card-header h2 {
    font-size: 1.8rem;
  }

  .login-card-header p {
    font-size: 1.05rem;
  }

  .login-card .mb-3 {
    margin-bottom: 0.7rem !important;
  }

  .login-card .form-label {
    margin-bottom: 0.25rem;
    font-size: 1rem;
  }

  .login-card .form-control {
    min-height: 3.15rem;
    height: 3.15rem;
    padding: 0.5rem 0.75rem 0.5rem 3rem;
    font-size: 1rem;
  }

  .login-field-icon {
    left: 0.8rem;
    width: 1.2rem;
    height: 1.2rem;
  }

  .login-card .login-password-input {
    padding-right: 3rem;
  }

  .login-password-toggle {
    right: 0.45rem;
    width: 2.1rem;
    height: 2.1rem;
  }

  .login-password-toggle svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  .login-options {
    min-height: 1.8rem;
    margin: 0.1rem 0 0.8rem;
    font-size: 0.95rem;
  }

  .login-options .form-check {
    padding-left: 1.55rem;
  }

  .login-options .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin-left: -1.55rem;
  }

  .login-options .form-check-label {
    padding-left: 0.15rem;
  }

  .login-card .login-submit {
    min-height: 3.6rem;
    height: 3.6rem;
    font-size: 1.2rem;
  }

  .login-card .login-submit svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .login-attribution {
    margin-top: 0.45rem;
    font-size: 0.7rem;
  }
}

/* ==========================================================================
   INICIO (DASHBOARD)
   ========================================================================== */
.home-kpis, .home-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.home-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.home-card { padding: 20px 24px; }
.home-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.home-card__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 600; line-height: 26px; color: var(--jimal-text); }
.home-card__title-icon { display: inline-flex; color: var(--jimal-primary); }
.home-card__title-icon svg { width: 20px; height: 20px; }
.home-card__subtitle { margin: 0; font-size: 13px; line-height: 20px; color: var(--jimal-text-muted); }
.home-card__link { font-size: 13px; font-weight: 600; color: var(--jimal-primary-active); text-decoration: none; }
.home-card__link:hover { text-decoration: underline; }

.home-activity, .home-taller { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.home-activity > li + li { border-top: 1px solid var(--jimal-border); }
.home-activity__item, .home-taller__item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 8px; border-radius: var(--jimal-radius); color: var(--jimal-text); text-decoration: none; }
.home-activity__item { min-height: 64px; }
.home-activity__item:hover, .home-taller__item:hover { background: var(--jimal-canvas); color: var(--jimal-text); }
.home-activity__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--jimal-radius); background: var(--jimal-primary-light); color: var(--jimal-primary); }
.home-activity__icon svg { width: 20px; height: 20px; }
.home-activity__icon--info { background: var(--jimal-info-bg); color: var(--jimal-info-text); }
.home-activity__icon--success { background: var(--jimal-success-bg); color: var(--jimal-success-text); }
.home-activity__icon--neutral { background: var(--jimal-surface-tint); color: var(--jimal-text-secondary); }
.home-activity__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-activity__title { font-size: 14px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere; }
.home-activity__folio { margin-right: 6px; color: var(--jimal-primary-active); }
.home-activity__detail { font-size: 13px; line-height: 18px; color: var(--jimal-text-muted); overflow-wrap: anywhere; }
.home-activity__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.home-activity__time { font-size: 12px; color: var(--jimal-text-muted); white-space: nowrap; }
.home-taller { gap: 8px; }
.home-taller__item { background: var(--jimal-canvas); border: 1px solid var(--jimal-border); padding: 10px 12px; }
.home-taller__item:hover { border-color: var(--jimal-border-strong); background: var(--jimal-surface); }

.home-alert { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.home-alert__icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: var(--jimal-radius); background: var(--jimal-warning-bg); color: var(--jimal-warning-text); }
.home-alert__icon svg { width: 20px; height: 20px; }
.home-alert__copy { flex: 1 1 auto; min-width: 0; }
.home-alert__title { margin: 0; font-size: 14px; font-weight: 600; line-height: 20px; }
.home-alert__text { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--jimal-text-muted); overflow-wrap: anywhere; }

.home-chart { display: block; width: 100%; height: auto; }
.home-chart__bar { fill: var(--jimal-info-bg); }
.home-chart__bar--today { fill: var(--jimal-primary); }
.home-chart__label { fill: var(--jimal-text-muted); font: 500 10px var(--jimal-font-mono); }
.home-chart__label--today { fill: var(--jimal-primary-active); font-weight: 700; }
.home-chart__tip { fill: var(--jimal-text); }
.home-chart__tip-text { fill: var(--jimal-surface); font: 500 11px var(--jimal-font-mono); }

@media (max-width: 1100px) {
  .home-kpis, .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .home-kpis, .home-actions { gap: 12px; }
  .home-card { padding: 16px; }
  .home-activity__item { grid-template-columns: 40px minmax(0, 1fr); }
  .home-activity__meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .home-alert { flex-wrap: wrap; }
  .home-alert > .btn { width: 100%; }
}
@media (max-width: 479px) {
  .home-actions { grid-template-columns: minmax(0, 1fr); }
  .home-kpis .kpi-card { padding: 16px; }
}
@media (max-width: 359px) {
  .home-kpis { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   LISTADOS (filtros, filas, menú de acciones y tarjetas de resumen)
   ========================================================================== */
.chip-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.list-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.list-toolbar__search { flex: 1 1 auto; border-radius: var(--jimal-radius); }
.list-toolbar__filters { position: relative; }
.list-toolbar__filters > summary, .row-menu > summary { list-style: none; cursor: pointer; }
.list-toolbar__filters > summary::-webkit-details-marker, .row-menu > summary::-webkit-details-marker { display: none; }
.list-toolbar__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; display: flex; flex-direction: column; gap: 12px; width: 280px; max-width: calc(100vw - 32px); padding: 16px; box-shadow: var(--jimal-shadow-3); }
.list-toolbar__submit { display: none; }
.list-note { margin: 0 0 16px; font-size: 12px; line-height: 18px; color: var(--jimal-text-muted); }

.order-list { display: flex; flex-direction: column; gap: 12px; margin: 0 0 24px; padding: 0; list-style: none; }
.order-row { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto 36px; align-items: center; gap: 16px; padding: 14px 16px; }
.order-row__icon, .stat-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--jimal-radius); background: var(--jimal-surface-tint); color: var(--jimal-text-secondary); }
.order-row__icon svg, .stat-card__icon svg { width: 24px; height: 24px; }
.order-row__main { min-width: 0; }
.order-row__title, .order-row__moto { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.order-row__title { font-size: 16px; font-weight: 700; line-height: 24px; }
.order-row__customer { font-size: 14px; font-weight: 500; color: var(--jimal-text-secondary); }
.order-row__moto { margin-top: 2px; font-size: 13px; line-height: 20px; color: var(--jimal-text-muted); }
.order-row__link { color: var(--jimal-text); text-decoration: none; }
.order-row__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--jimal-radius-lg); }
.order-row__link:focus-visible { outline: none; }
.order-row__link:focus-visible::after { box-shadow: 0 0 0 3px var(--jimal-primary-ring); border: 1px solid var(--jimal-primary); }
.order-row__figures { display: flex; flex-direction: column; align-items: flex-end; min-width: 96px; text-align: right; }
.order-row__date { font-size: 12px; line-height: 18px; color: var(--jimal-text-muted); }
.order-row__total { font-size: 18px; font-weight: 700; line-height: 26px; font-variant-numeric: tabular-nums; }
.row-menu { position: relative; z-index: 2; }
.row-menu__panel { position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 180px; padding: 4px; box-shadow: var(--jimal-shadow-3); }
.row-menu__item { display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: var(--jimal-radius-sm); color: var(--jimal-text); font-size: 14px; font-weight: 500; text-decoration: none; }
.row-menu__item:hover, .row-menu__item:focus-visible { background: var(--jimal-canvas); color: var(--jimal-text); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.stat-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.stat-card__icon--success { background: var(--jimal-success-bg); color: var(--jimal-success-text); }
.stat-card__icon--info { background: var(--jimal-info-bg); color: var(--jimal-info-text); }
.stat-card__icon--warning { background: var(--jimal-warning-bg); color: var(--jimal-warning-text); }
.stat-card__label { margin: 0; font-size: 12px; line-height: 18px; color: var(--jimal-text-muted); }
.stat-card__value { display: block; font-size: 22px; font-weight: 700; line-height: 30px; font-variant-numeric: tabular-nums; }

@media (max-width: 767px) {
  .list-toolbar { flex-wrap: wrap; }
  .list-toolbar__search { flex-basis: 100%; }
  .list-toolbar__filters { flex: 1 1 auto; }
  .list-toolbar__filters > summary { width: 100%; }
  .list-toolbar__panel { left: 0; right: auto; }
  .list-toolbar__submit { display: inline-flex; flex: 1 1 auto; }
  .chip-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .order-row { grid-template-columns: 40px minmax(0, 1fr) 36px; gap: 8px 12px; padding: 12px; }
  .order-row__icon { width: 40px; height: 40px; }
  .order-row__status, .order-row__figures { grid-column: 2; }
  .order-row__figures { flex-direction: row; align-items: baseline; justify-content: space-between; text-align: left; }
  .row-menu { grid-column: 3; grid-row: 1; }
}
.chip-filters .chip-filter { flex: 0 0 auto; white-space: nowrap; }
.part-thumb { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius); background: var(--jimal-canvas); color: var(--jimal-text-muted); }
.part-thumb svg { width: 22px; height: 22px; }
.table-pagination__gap { padding: 0 4px; color: var(--jimal-text-muted); }
.chip-filters__more > summary { list-style: none; cursor: pointer; }
.data-table a.mono { color: var(--jimal-text); text-decoration: none; }
.data-table a.mono:hover { color: var(--jimal-primary-active); text-decoration: underline; }
.data-table td .mono { white-space: nowrap; }
.row-menu:not(.is-placed) > .row-menu__panel { visibility: hidden; }
@media (scripting: none) { .row-menu:not(.is-placed) > .row-menu__panel { visibility: visible; } }

/* ==========================================================================
   PUNTO DE VENTA
   ========================================================================== */
.pos-tabs { display: none; margin-bottom: 12px; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--jimal-ticket-w); gap: 20px; align-items: start; }
.pos-catalog { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pos-search { display: flex; gap: 8px; }
.pos-search .search-field { flex: 1 1 auto; }
.pos-hint { min-height: 18px; margin: 0; font-size: 12px; color: var(--jimal-text-muted); }
.pos-products { overflow: hidden; }
.pos-list { max-height: calc(100vh - 340px); min-height: 240px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.pos-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--jimal-border); }
.pos-item[hidden] { display: none; }
.pos-item:last-child { border-bottom: 0; }
.pos-item__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--jimal-radius); background: var(--jimal-surface-tint); color: var(--jimal-text-secondary); }
.pos-item__icon svg { width: 24px; height: 24px; }
.pos-item__info { display: flex; flex-direction: column; min-width: 0; }
.pos-item__code { font-size: 12px; color: var(--jimal-text-muted); }
.pos-item__name { font-size: 16px; font-weight: 600; line-height: 22px; overflow-wrap: anywhere; }
.pos-item__meta { font-size: 13px; color: var(--jimal-text-muted); }
.pos-item__meta strong { color: var(--jimal-text); }
.pos-item__price { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-item__add:disabled { background: var(--jimal-neutral-bg); border-color: var(--jimal-border); color: var(--jimal-neutral-text); }

.pos-ticket { position: sticky; top: calc(var(--jimal-topbar-h) + 16px); display: flex; flex-direction: column; gap: 14px; height: calc(100vh - var(--jimal-topbar-h) - 32px); padding: 20px; overflow: hidden; }
.pos-ticket__lines { flex: 1 1 auto; min-height: 120px; overflow-y: auto; }
.pos-ticket > * { flex-shrink: 0; }
.pos-ticket > .pos-ticket__lines { flex-shrink: 1; }
.pos-ticket__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 20px; font-weight: 700; }
.pos-ticket__title-icon { display: inline-flex; color: var(--jimal-primary); }
.pos-ticket__title-icon svg { width: 22px; height: 22px; }
.pos-ticket__customer { display: flex; flex-direction: column; gap: 8px; }
.pos-field-hint { margin: 0; font-size: 12px; color: var(--jimal-danger-text); }
.pos-segment, .pos-methods { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.pos-segment__option input, .pos-method input { position: absolute; opacity: 0; pointer-events: none; }
.pos-segment__option span, .pos-method span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius); background: var(--jimal-surface); color: var(--jimal-text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; }
.pos-method span svg { width: 18px; height: 18px; }
.pos-segment__option input:checked + span, .pos-method input:checked + span { border-color: var(--jimal-primary); background: var(--jimal-primary-light); color: var(--jimal-primary-active); }
.pos-segment__option input:focus-visible + span, .pos-method input:focus-visible + span { box-shadow: 0 0 0 3px var(--jimal-primary-ring); }
.pos-ticket__lines-head { display: flex; align-items: center; justify-content: space-between; }
.pos-ticket__subtitle { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--jimal-text-muted); }
.pos-empty { margin: 16px 0; font-size: 13px; text-align: center; color: var(--jimal-text-muted); }
.pos-lines { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; align-items: center; gap: 6px 8px; padding: 10px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius); background: var(--jimal-surface); }
.pos-line__info { display: flex; flex-direction: column; min-width: 0; }
.pos-line__name { font-size: 14px; overflow-wrap: anywhere; }
.pos-line__each { font-size: 12px; color: var(--jimal-text-muted); font-variant-numeric: tabular-nums; }
.pos-line__total { font-size: 15px; font-variant-numeric: tabular-nums; }
.pos-line__discount { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--jimal-text-muted); }
.pos-line__discount-input { width: 80px; padding: 2px 6px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius-sm); font: 400 13px var(--jimal-font); }
.pos-stepper { display: inline-flex; align-items: center; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius-sm); }
.pos-stepper__btn { width: 32px; height: 32px; border: 0; background: transparent; color: var(--jimal-text); font-size: 16px; cursor: pointer; }
.pos-stepper__input { width: 48px; height: 32px; border: 0; background: transparent; text-align: center; font: 600 13px var(--jimal-font); }
.pos-notes summary { cursor: pointer; font-size: 13px; color: var(--jimal-text-muted); }
.pos-notes input { margin-top: 8px; }
.pos-totals { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-top: 12px; border-top: 1px solid var(--jimal-border); }
.pos-totals__row, .pos-totals__total { display: flex; align-items: baseline; justify-content: space-between; margin: 0; }
.pos-totals dt { font-weight: 500; color: var(--jimal-text-muted); }
.pos-totals dd { margin: 0; }
.pos-totals__total { padding-top: 8px; }
.pos-totals__total dt { font-size: 20px; font-weight: 700; color: var(--jimal-text); }
.pos-totals__total dd { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pos-note { margin: 0; font-size: 12px; line-height: 18px; color: var(--jimal-warning-text); }
.pos-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.pos-pay { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; font-size: 16px; }
.pos-pay svg { width: 20px; height: 20px; }
.pos-draft { align-self: center; }
.pos-scanner { width: min(92vw, 420px); padding: 20px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius-lg); box-shadow: var(--jimal-shadow-3); }
.pos-scanner::backdrop { background: rgba(15, 23, 42, 0.5); }
.pos-scanner__title { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.pos-scanner__video { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--jimal-radius); background: var(--jimal-text); }
.pos-scanner__message { margin: 12px 0; font-size: 13px; color: var(--jimal-text-muted); }

@media (max-width: 1023px) {
  .pos-tabs { display: inline-flex; }
  .pos-layout { grid-template-columns: minmax(0, 1fr); }
  .pos[data-view="catalog"] [data-pos-panel="ticket"], .pos[data-view="ticket"] [data-pos-panel="catalog"] { display: none; }
  .pos-ticket { position: static; height: auto; overflow: visible; }
  .pos-ticket__lines { overflow: visible; }
  .pos-list { max-height: none; }
}
@media (max-width: 767px) {
  .pos-item { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px; }
  .pos-item__icon { width: 40px; height: 40px; }
  .pos-item__add { grid-column: 2 / -1; }
}
.pos-tabs [data-pos-count] { margin-left: 6px; }

/* ==========================================================================
   DETALLES (cabecera, tarjetas de información, resumen)
   ========================================================================== */
.breadcrumb-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--jimal-text-muted); }
.breadcrumb-trail a { color: var(--jimal-text-muted); text-decoration: none; }
.breadcrumb-trail a:hover { color: var(--jimal-primary-active); text-decoration: underline; }
.breadcrumb-trail [aria-current="page"] { color: var(--jimal-primary-active); font-weight: 600; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; margin-bottom: 20px; }
.detail-head .page-header__title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0; }
.detail-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.info-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; }
.info-card__label { margin: 0; font: 600 11px/16px var(--jimal-font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--jimal-text-muted); }
.info-card__value { font-size: 18px; font-weight: 700; line-height: 26px; overflow-wrap: anywhere; }
.info-card__muted { font-weight: 400; color: var(--jimal-text-muted); }
.info-card__text { margin: 0; font-size: 13px; line-height: 20px; color: var(--jimal-text-muted); }
.info-card__link { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--jimal-primary-active); }
.link-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; margin-bottom: 20px; background: var(--jimal-success-bg); }
.link-card .form-control { flex: 1 1 280px; }
.card-title-bar { display: flex; align-items: center; gap: 8px; margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--jimal-border); font-size: 16px; font-weight: 600; }
.quote-summary { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; padding: 20px; border-top: 1px solid var(--jimal-border); }
.quote-summary__title { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.quote-totals { padding: 0; border: 0; }
.quote-qty { max-width: 140px; }
@media (max-width: 1100px) { .detail-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .detail-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; } .quote-summary { grid-template-columns: minmax(0, 1fr); } .detail-head { padding: 16px; } }

/* ==========================================================================
   AGENDA (calendario semanal y lista)
   ========================================================================== */
.agenda-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.agenda-bar__nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agenda-bar__title { margin: 0 0 0 8px; font-size: 18px; font-weight: 600; }
.cal { overflow: hidden; margin-bottom: 16px; }
.cal__scroll { overflow-x: auto; }
.cal__grid { display: grid; grid-template-columns: 64px repeat(6, minmax(120px, 1fr)); min-width: 780px; }
.cal__grid--1 { grid-template-columns: 64px minmax(160px, 1fr); min-width: 0; }
.cal__corner, .cal__dayhead { border-bottom: 1px solid var(--jimal-border); background: var(--jimal-surface); }
.cal__dayhead { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-left: 1px solid var(--jimal-border); font-size: 12px; color: var(--jimal-text-muted); }
.cal__dayhead--today { background: var(--jimal-primary-light); color: var(--jimal-primary-active); }
.cal__daynum { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; border-radius: var(--jimal-radius-pill); font-size: 18px; color: var(--jimal-text); }
.cal__dayhead--today .cal__daynum { background: var(--jimal-primary); color: var(--jimal-on-primary); }
.cal__hours { display: grid; grid-template-rows: repeat(10, 72px); }
.cal__hour { padding: 2px 8px 0 0; text-align: right; font-size: 11px; color: var(--jimal-text-muted); }
.cal__day { display: grid; grid-template-rows: repeat(20, 36px); grid-template-columns: minmax(0, 1fr); gap: 0 2px; padding: 0 3px; border-left: 1px solid var(--jimal-border); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 71px, var(--jimal-border) 71px, var(--jimal-border) 72px); }
.cal__day--today { background-color: var(--jimal-primary-light); }
.cal__day--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cal__day--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cal__day--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cal__event { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; margin: 1px 0; padding: 4px 8px; border: 1px solid; border-radius: var(--jimal-radius); font-size: 12px; line-height: 16px; text-decoration: none; }
.cal__event strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.cal__event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.cal__event:hover { box-shadow: var(--jimal-shadow-2); }
.cal__event--warning, .cal-legend__swatch--warning { background: var(--jimal-warning-bg); border-color: var(--jimal-warning); color: var(--jimal-warning-text); }
.cal__event--success, .cal-legend__swatch--success { background: var(--jimal-success-bg); border-color: var(--jimal-success); color: var(--jimal-success-text); }
.cal__event--info, .cal-legend__swatch--info { background: var(--jimal-info-bg); border-color: var(--jimal-info); color: var(--jimal-info-text); }
.cal__event--danger, .cal-legend__swatch--danger { background: var(--jimal-danger-bg); border-color: var(--jimal-danger); color: var(--jimal-danger-text); }
.cal__event--neutral, .cal-legend__swatch--neutral { background: var(--jimal-neutral-bg); border-color: var(--jimal-border-strong); color: var(--jimal-neutral-text); }
.cal-legend { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; color: var(--jimal-text-muted); }
.cal-legend__items { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.cal-legend__items li { display: flex; align-items: center; gap: 8px; }
.cal-legend__swatch { width: 14px; height: 14px; border: 1px solid; border-radius: var(--jimal-radius-sm); }
.cal-list { margin-bottom: 16px; }
.cal-list--mobile { display: none; }
.cal-list__heading { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.cal-list__date { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; font-size: 15px; font-weight: 600; }
.cal-list__items { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cal-list__item { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 16px; }
.cal-list__time { display: flex; flex-direction: column; font-size: 16px; font-weight: 700; }
.cal-list__time small { font-size: 11px; font-weight: 400; color: var(--jimal-text-muted); }
.cal-list__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-list__reason { font-size: 13px; color: var(--jimal-text-muted); }
.cal-list__side { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@media (max-width: 767px) {
  .cal, .cal-list--desktop { display: none; }
  .cal-list--mobile { display: block; }
  .cal-list__item { grid-template-columns: 64px minmax(0, 1fr); }
  .cal-list__side { grid-column: 1 / -1; justify-content: flex-start; }
}
.cal__row-1 { grid-row-start: 1; }
.cal__row-2 { grid-row-start: 2; }
.cal__row-3 { grid-row-start: 3; }
.cal__row-4 { grid-row-start: 4; }
.cal__row-5 { grid-row-start: 5; }
.cal__row-6 { grid-row-start: 6; }
.cal__row-7 { grid-row-start: 7; }
.cal__row-8 { grid-row-start: 8; }
.cal__row-9 { grid-row-start: 9; }
.cal__row-10 { grid-row-start: 10; }
.cal__row-11 { grid-row-start: 11; }
.cal__row-12 { grid-row-start: 12; }
.cal__row-13 { grid-row-start: 13; }
.cal__row-14 { grid-row-start: 14; }
.cal__row-15 { grid-row-start: 15; }
.cal__row-16 { grid-row-start: 16; }
.cal__row-17 { grid-row-start: 17; }
.cal__row-18 { grid-row-start: 18; }
.cal__row-19 { grid-row-start: 19; }
.cal__row-20 { grid-row-start: 20; }
.cal__span-1 { grid-row-end: span 1; }
.cal__span-2 { grid-row-end: span 2; }
.cal__span-3 { grid-row-end: span 3; }
.cal__span-4 { grid-row-end: span 4; }
.cal__span-5 { grid-row-end: span 5; }
.cal__span-6 { grid-row-end: span 6; }
.cal__span-7 { grid-row-end: span 7; }
.cal__span-8 { grid-row-end: span 8; }
.cal__span-9 { grid-row-end: span 9; }
.cal__span-10 { grid-row-end: span 10; }
.cal__span-11 { grid-row-end: span 11; }
.cal__span-12 { grid-row-end: span 12; }
.cal__span-13 { grid-row-end: span 13; }
.cal__span-14 { grid-row-end: span 14; }
.cal__span-15 { grid-row-end: span 15; }
.cal__span-16 { grid-row-end: span 16; }
.cal__span-17 { grid-row-end: span 17; }
.cal__span-18 { grid-row-end: span 18; }
.cal__span-19 { grid-row-end: span 19; }
.cal__span-20 { grid-row-end: span 20; }
.cal__col-1 { grid-column: 1; }
.cal__col-2 { grid-column: 2; }
.cal__col-3 { grid-column: 3; }
.cal__col-4 { grid-column: 4; }
.pill-tabs__tab[aria-current="page"] { color: var(--jimal-primary); background: var(--jimal-surface); box-shadow: var(--jimal-shadow-1); }

/* Detalle de orden */
.order-nav { margin-bottom: 20px; }
.order-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.order-call { align-self: flex-start; margin-top: 4px; }
.order-jobs { margin-top: 20px; overflow: hidden; }
.order-jobs__title { margin: 0; font-size: 16px; font-weight: 600; }
.order-jobs .card-title-bar { justify-content: space-between; }
.order-jobs__empty { margin: 0; padding: 20px; color: var(--jimal-text-muted); }
.order-jobs__list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 16px 20px; list-style: none; }
.order-job { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 12px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius); background: var(--jimal-surface); }
.order-job__check { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 2px solid var(--jimal-border-strong); border-radius: var(--jimal-radius-sm); font-size: 14px; line-height: 1; color: var(--jimal-on-primary); }
.order-job--done .order-job__check { border-color: var(--jimal-primary); background: var(--jimal-primary); }
.order-job--done .order-job__name { color: var(--jimal-text-muted); text-decoration: line-through; }
.order-job__body { display: flex; flex-direction: column; min-width: 0; }
.order-job__meta { font-size: 13px; color: var(--jimal-text-muted); }
.order-job__price { font-size: 14px; font-weight: 600; }
.order-jobs__add { display: block; margin: 0 20px 20px; padding: 12px; border: 1px dashed var(--jimal-primary-border); border-radius: var(--jimal-radius); text-align: center; font-weight: 600; color: var(--jimal-primary-active); text-decoration: none; }
.order-fab { display: none; }
@media (max-width: 1100px) { .order-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .order-cards { grid-template-columns: minmax(0, 1fr); }
  .order-head .page-header__actions { display: none; }
  .order-fab { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; justify-content: center; min-height: 52px; font-size: 16px; box-shadow: var(--jimal-shadow-3); }
  .order-nav { margin-left: -16px; margin-right: -16px; padding: 0 16px; }
}
.order-nav { flex-wrap: nowrap; } .order-nav .tabs__tab { flex: 0 0 auto; }

/* ==========================================================================
   PORTAL PÚBLICO DE AUTORIZACIÓN
   ========================================================================== */
.portal-top { background: var(--jimal-surface); border-bottom: 1px solid var(--jimal-border); }
.portal-top__inner, .portal, .portal-foot { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.portal-top__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.portal-brand { display: flex; align-items: center; gap: 12px; }
.portal-brand img { height: auto; }
.portal-brand__name { display: block; font-size: 18px; font-weight: 800; color: var(--jimal-primary-active); }
.portal-brand__tag { display: block; font: 500 11px var(--jimal-font-mono); color: var(--jimal-text-muted); }
.portal-official svg { width: 14px; height: 14px; }
.portal { padding-top: 24px; padding-bottom: 32px; }
.portal-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--jimal-border); }
.portal-title__text { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.portal-title__sub { margin: 6px 0 0; color: var(--jimal-text-muted); }
.portal-title__actions { display: flex; gap: 8px; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.portal-main, .portal-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.portal-card { padding: 20px 24px; }
.portal-card__title { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.portal-hint { margin: 0 0 12px; font-size: 13px; line-height: 20px; color: var(--jimal-text-muted); }
.portal-count { font-size: 13px; color: var(--jimal-text-muted); }
.portal-totals { padding: 16px 20px; border-top: 1px solid var(--jimal-border); }
.portal-total { color: var(--jimal-primary-active); }
.portal-currency { margin: 4px 0 0; text-align: right; font-size: 12px; color: var(--jimal-text-muted); }
.portal-partial { margin-bottom: 16px; padding: 12px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius); }
.portal-partial summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.portal-actions { display: flex; flex-direction: column; gap: 8px; }
.portal-actions .btn { min-height: 48px; }
.portal-accept { font-size: 16px; }
.portal-reject { color: var(--jimal-danger-text); }
.portal-contact { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; padding: 12px 16px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius); color: var(--jimal-text); text-decoration: none; }
.portal-contact span { font-size: 12px; color: var(--jimal-text-muted); }
.portal-contact--wa { border-color: var(--jimal-success); background: var(--jimal-success-bg); }
.portal-address { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--jimal-border); font-size: 13px; color: var(--jimal-text-muted); }
.portal-done { max-width: 560px; margin: 48px auto; }
.portal-foot { padding-top: 16px; padding-bottom: 24px; border-top: 1px solid var(--jimal-border); font-size: 13px; color: var(--jimal-text-muted); }
@media (max-width: 900px) { .portal-grid { grid-template-columns: minmax(0, 1fr); } .portal-side { order: -1; } }
@media (max-width: 767px) { .portal-top__inner, .portal, .portal-foot { padding-left: 16px; padding-right: 16px; } .portal-title__text { font-size: 22px; } .portal-card { padding: 16px; } }
@media print { .portal-side, .portal-title__actions, .portal-official { display: none; } .portal-grid { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   VISTAS HEREDADAS: las clases anteriores toman los tokens y medidas de Stitch
   ========================================================================== */
.app-shell .app-page-header { margin-bottom: 24px; }
.app-shell .app-page-title { font-size: 30px; line-height: 38px; font-weight: 700; letter-spacing: -0.02em; }
.app-shell .app-page-subtitle { margin-top: 4px; font-size: 14px; line-height: 20px; } .app-shell .table-modern-wrapper { background: var(--jimal-surface); border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius-lg); box-shadow: var(--jimal-shadow-1); }
.app-shell .table-modern-wrapper { overflow-x: auto; }
.app-shell .table-modern th { background: var(--jimal-canvas); color: var(--jimal-text-muted); font-size: 11px; font-weight: 700; line-height: 16px; }
.app-shell .table-modern td { font-size: 13px; line-height: 20px; }
.app-shell .table-modern tbody tr:hover { background: var(--jimal-canvas); }
.app-shell .badge { padding: 4px 10px; border-radius: var(--jimal-radius-pill); font-size: 11px; font-weight: 600; line-height: 16px; }
.app-shell .chip-proceso, .app-shell .chip-recibida, .app-shell .chip-en_reparacion { background: var(--jimal-info-bg); color: var(--jimal-info-text); }
.app-shell .chip-diagnostico, .app-shell .chip-en_diagnostico, .app-shell .chip-espera, .app-shell .chip-en_espera, .app-shell .chip-pendiente_cliente, .app-shell .chip-pendiente_autorizacion { background: var(--jimal-warning-bg); color: var(--jimal-warning-text); }
.app-shell .chip-lista, .app-shell .chip-lista_entrega, .app-shell .chip-entregada, .app-shell .chip-completada, .app-shell .chip-confirmada, .app-shell .chip-vigente { background: var(--jimal-success-bg); color: var(--jimal-success-text); }
.app-shell .chip-warn, .app-shell .chip-alerta, .app-shell .chip-stock_bajo, .app-shell .chip-no_reparada, .app-shell .chip-cancelada, .app-shell .chip-rechazada { background: var(--jimal-danger-bg); color: var(--jimal-danger-text); }
.app-shell .amount { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-shell .amount--in { color: var(--jimal-success-text); }
.app-shell .amount--out { color: var(--jimal-danger-text); }
.app-shell .section { margin-top: 20px; padding: 20px; background: var(--jimal-surface); border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius-lg); }
.app-shell .section > h2, .app-shell .section > summary { font-size: 16px; font-weight: 600; }
.app-shell .app-main, .app-shell .app-main-area { min-width: 0; }
.app-shell .table-responsive { max-width: 100%; overflow-x: auto; }
.app-shell .table-modern { min-width: 560px; }
.app-shell .table-responsive, .data-table-wrapper, .table-modern-wrapper { position: relative; }

/* ==========================================================================
   AGENDA: citas del día + calendario de disponibilidad + próximas citas
   ========================================================================== */
.agenda-overview { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.agenda-overview__side { display: grid; gap: 20px; }
.agenda-day, .agenda-month, .agenda-upcoming { padding: 20px; }
.agenda-day__head, .agenda-month__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.agenda-day__title, .agenda-month__title, .agenda-upcoming__title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.agenda-day__sub { margin: 2px 0 0; color: var(--jimal-text-muted); font-size: 13px; }
.agenda-day__nav { display: flex; gap: 6px; }
.agenda-day__closed { margin: 0 0 12px; color: var(--jimal-text-muted); }
.agenda-free { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--jimal-border); }
.agenda-free__label { font-size: 12px; font-weight: 600; color: var(--jimal-text-muted); margin-right: 2px; }
.agenda-day__empty { padding: 24px 0 8px; }
.agenda-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.agenda-list__item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius); background: var(--jimal-surface); }
.agenda-list__item--dim { opacity: 0.6; }
.agenda-list__time { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; }
.agenda-list__time small { font-weight: 500; font-size: 11px; color: var(--jimal-text-subtle); }
.agenda-list__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agenda-list__body > span { color: var(--jimal-text-muted); font-size: 13px; overflow-wrap: anywhere; }
.agenda-list__body a { color: inherit; text-decoration: none; }
.agenda-list__body a:hover { color: var(--jimal-primary); text-decoration: underline; }
.agenda-list__meta { font-size: 12px; }

.agenda-month__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.agenda-month__dow { text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--jimal-text-subtle); padding: 4px 0; }
.agenda-month__day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; min-height: 40px; border-radius: var(--jimal-radius); border: 1px solid transparent; text-decoration: none; color: var(--jimal-text); font-size: 13px; font-weight: 600; background: var(--jimal-success-bg); }
.agenda-month__day:hover { border-color: var(--jimal-border-strong); }
.agenda-month__day--ocupado { background: var(--jimal-warning-bg); }
.agenda-month__day--lleno { background: var(--jimal-danger-bg); }
.agenda-month__day--cerrado { background: var(--jimal-neutral-bg); color: var(--jimal-text-subtle); }
.agenda-month__day.is-past { opacity: 0.55; }
.agenda-month__day.is-today { box-shadow: inset 0 0 0 2px var(--jimal-primary); }
.agenda-month__day.is-selected { border-color: var(--jimal-text); box-shadow: 0 0 0 2px var(--jimal-primary-ring); }
.agenda-month__count { position: absolute; top: 3px; right: 4px; min-width: 16px; padding: 0 4px; border-radius: 9999px; background: var(--jimal-text); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.agenda-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 14px 0 0; padding: 0; font-size: 12px; color: var(--jimal-text-muted); }
.agenda-legend li { display: inline-flex; align-items: center; gap: 6px; }
.agenda-legend__dot { width: 12px; height: 12px; border-radius: 4px; background: var(--jimal-success-bg); border: 1px solid var(--jimal-border); }
.agenda-legend__dot--ocupado { background: var(--jimal-warning-bg); }
.agenda-legend__dot--lleno { background: var(--jimal-danger-bg); }
.agenda-legend__dot--cerrado { background: var(--jimal-neutral-bg); }

.agenda-upcoming__title { margin-bottom: 12px; }
.agenda-upcoming__empty { margin: 0; color: var(--jimal-text-muted); font-size: 13px; }
.agenda-upcoming__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.agenda-upcoming__item { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius); text-decoration: none; color: inherit; }
.agenda-upcoming__item:hover { border-color: var(--jimal-border-strong); background: var(--jimal-canvas); }
.agenda-upcoming__when { display: flex; flex-direction: column; font-size: 12px; font-weight: 700; }
.agenda-upcoming__what { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.agenda-upcoming__what span { color: var(--jimal-text-muted); font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 1100px) { .agenda-overview { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .agenda-list__item { grid-template-columns: 52px minmax(0, 1fr); }
  .agenda-list__item .chip { grid-column: 2; justify-self: start; }
  .agenda-day, .agenda-month, .agenda-upcoming { padding: 16px; }
}

/* ==========================================================================
   DETALLE DE PRODUCTO (pd-*) Y FORMULARIO AGRUPADO (pf-*)
   ========================================================================== */
.pd-crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--jimal-text-muted); }
.pd-crumbs a { color: var(--jimal-text-muted); text-decoration: none; }
.pd-crumbs a:hover { color: var(--jimal-primary); text-decoration: underline; }
.pd-head__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }
.pd-head__brand { color: var(--jimal-text-muted); font-size: 13px; }
.pd-alert { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--jimal-warning); border-radius: var(--jimal-radius); background: var(--jimal-warning-bg); color: var(--jimal-warning-text); font-size: 14px; }
.pd-alert a { color: inherit; font-weight: 700; }

.pd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.pd-stat { padding: 16px 18px; border: 1px solid var(--jimal-border); border-radius: var(--jimal-radius-lg); background: var(--jimal-surface); box-shadow: var(--jimal-shadow-1); }
.pd-stat__label { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--jimal-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.pd-stat__value { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.pd-stat__value small { font-size: 13px; font-weight: 500; color: var(--jimal-text-muted); letter-spacing: 0; }
.pd-stat__value--danger { color: var(--jimal-danger-text); }
.pd-stat__hint { margin: 6px 0 0; font-size: 12px; color: var(--jimal-text-muted); }
.pd-progress { display: block; width: 100%; height: 8px; margin-top: 10px; border: 0; border-radius: 9999px; background: var(--jimal-neutral-bg); overflow: hidden; appearance: none; -webkit-appearance: none; }
.pd-progress::-webkit-progress-bar { background: var(--jimal-neutral-bg); }
.pd-progress::-webkit-progress-value { border-radius: 9999px; background: var(--jimal-success); }
.pd-progress::-moz-progress-bar { border-radius: 9999px; background: var(--jimal-success); }
.pd-progress--warning::-webkit-progress-value { background: var(--jimal-warning); }
.pd-progress--warning::-moz-progress-bar { background: var(--jimal-warning); }
.pd-progress--danger::-webkit-progress-value { background: var(--jimal-danger); }
.pd-progress--danger::-moz-progress-bar { background: var(--jimal-danger); }

.pd-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; align-items: start; }
.pd-card { padding: 20px; }
.pd-card__title { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.pd-list { margin: 0; }
.pd-row { display: grid; grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--jimal-border); }
.pd-row:last-child { border-bottom: 0; }
.pd-row dt { color: var(--jimal-text-muted); font-size: 13px; font-weight: 500; }
.pd-row dd { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.pd-none { color: var(--jimal-text-subtle); font-weight: 400; }
.pd-desc { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--jimal-radius); background: var(--jimal-canvas); color: var(--jimal-text-muted); font-size: 13px; }

.pd-actions { display: grid; gap: 12px; margin-bottom: 20px; }
.pd-panel { padding: 0; }
.pd-panel > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 16px 20px; cursor: pointer; list-style: none; }
.pd-panel > summary::-webkit-details-marker { display: none; }
.pd-panel > summary::before { content: "▸"; margin-right: 4px; color: var(--jimal-text-muted); transition: transform 0.15s ease; }
.pd-panel[open] > summary::before { transform: rotate(90deg); }
.pd-panel > summary:focus-visible { outline: 2px solid var(--jimal-primary); outline-offset: -2px; border-radius: var(--jimal-radius-lg); }
.pd-panel__title { font-weight: 700; font-size: 15px; }
.pd-panel__hint { color: var(--jimal-text-muted); font-size: 13px; }
.pd-panel__body { padding: 4px 20px 20px; border-top: 1px solid var(--jimal-border); }
.pd-panel__actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.pd-panel--danger .pd-panel__title { color: var(--jimal-danger-text); }
.pd-panel:target { box-shadow: 0 0 0 3px var(--jimal-primary-ring); }
.pd-moves .num { text-align: right; }
.pd-pos { color: var(--jimal-success-text); }
.pd-neg { color: var(--jimal-danger-text); }

.pf-group { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.pf-group__title { float: none; width: auto; margin: 0 0 10px; padding: 0; font-size: 12px; font-weight: 700; color: var(--jimal-primary-hover); text-transform: uppercase; letter-spacing: 0.04em; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.pf-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-field { min-width: 0; }
.pf-field--wide { grid-column: 1 / -1; }
.pf-field--span2 { grid-column: span 2; }
.pf-field .form-label { margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.pf-field .form-text { margin: 4px 0 0; font-size: 12px; }

@media (max-width: 1100px) { .pd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .pd-columns { grid-template-columns: minmax(0, 1fr); }
  .pd-stats { gap: 12px; }
  .pd-stat__value { font-size: 24px; }
  .pf-grid, .pf-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .pf-field--span2 { grid-column: auto; }
  .pd-row { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); }
  .pd-panel__actions .btn { width: 100%; }
}
