:root {
  --shadow-soft: 0 10px 24px -18px rgba(15, 23, 42, 0.25);
  --shadow-card: 0 14px 30px -24px rgba(15, 23, 42, 0.22);
  --shadow-modal: 0 30px 55px -32px rgba(15, 23, 42, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.card-surface {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.animate-fade-in {
  animation: fadeIn 0.35s ease both;
}

.sidebar-item {
  transition: background-color 180ms ease, border-color 180ms ease;
}

.sidebar-item-active {
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.kpi-card {
  border-left: 4px solid #4f46e5;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.kpi-card:hover {
  box-shadow: 0 16px 28px -22px rgba(15, 23, 42, 0.28);
  transform: translateY(-1px);
}

.kpi-icon-wrap {
  display: inline-flex;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #eef2ff;
  color: #4f46e5;
}

.kpi-icon-wrap svg {
  width: 1.35rem;
  height: 1.35rem;
}

.table-grid {
  overflow-x: auto;
}

.table-grid table {
  min-width: 860px;
}

.table-shell {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
}

.table-head th {
  background: #f1f5f9;
  color: #64748b;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.table-row {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 150ms ease;
}

.table-row:nth-child(even) {
  background: #f8fafc;
}

.table-row:hover {
  background: #eef2ff;
}

.table-row-low {
  background: #fffbeb !important;
}

.table-row-pending {
  opacity: 0.5;
}

.pending-delete-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
}

.btn-primary {
  background: #4f46e5;
  color: #ffffff;
  border-radius: 0.5rem;
  transition: background-color 180ms ease;
}

.btn-primary:hover {
  background: #4338ca;
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
  border-radius: 0.5rem;
  transition: background-color 180ms ease;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-edit {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
  border-radius: 0.5rem;
  transition: background-color 180ms ease;
}

.btn-edit:hover {
  background: #fef3c7;
}

.btn-delete {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
  border-radius: 0.5rem;
  transition: background-color 180ms ease;
}

.btn-delete:hover {
  background: #ffe4e6;
}

.form-label {
  color: #334155;
  font-weight: 500;
}

.form-input,
.form-select {
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(199, 210, 254, 0.9);
}

.input-error {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 3px rgba(254, 205, 211, 0.8) !important;
}

.error-text {
  color: #be123c;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.875rem;
}

.input-shake {
  animation: shakeX 0.28s ease;
}

.empty-state {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  border: 1px dashed #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
}

.empty-state-icon {
  display: inline-flex;
  width: 3.25rem;
  height: 3.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  margin-bottom: 0.8rem;
}

.empty-state-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.empty-state-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}

.empty-state-subtitle {
  margin: 0.35rem 0 1rem;
  color: #64748b;
  font-size: 0.92rem;
}

.toast-shell {
  width: min(380px, calc(100vw - 2rem));
}

.toast-card {
  background: #ffffff;
  border-radius: 0.75rem;
  border-left: 4px solid #10b981;
  box-shadow: var(--shadow-soft);
}

.toast-card .toast-action {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 0.45rem;
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.toast-card .toast-action:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.toast-card-delete {
  border-left-color: #f43f5e;
}

.toast-card-warning {
  border-left-color: #f59e0b;
}

.toast-enter-active,
.toast-leave-active {
  transition: all 260ms ease;
}

.toast-enter-from,
.toast-leave-to {
  opacity: 0;
  transform: translateX(26px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-panel {
  width: min(540px, 100%);
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.2rem 0.8rem;
  border-bottom: 1px solid #e2e8f0;
}

.modal-body {
  padding: 1rem 1.2rem;
}

.modal-footer {
  padding: 0.9rem 1.2rem 1.2rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.modal-fade-enter-active,
.modal-fade-leave-active {
  transition: opacity 220ms ease, transform 220ms ease;
}

.modal-fade-enter-from,
.modal-fade-leave-to {
  opacity: 0;
}

.modal-fade-enter-from .modal-panel,
.modal-fade-leave-to .modal-panel {
  transform: scale(0.97);
}

.check-pop {
  animation: popIn 280ms ease;
}

.skeleton-row {
  height: 14px;
  border-radius: 0.4rem;
  background: #e2e8f0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    transform: scale(0.75);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shakeX {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

@media (max-width: 1024px) {
  .table-grid table {
    min-width: 760px;
  }
}

@media (max-width: 768px) {
  .table-grid table {
    min-width: 680px;
  }

  .modal-panel {
    width: 100%;
  }
}

.print-header {
  display: none;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #cbd5e1;
}

.print-header-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: #111827;
}

.print-header-meta {
  margin-top: 0.35rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #374151;
  font-size: 0.85rem;
}

.print-footer {
  display: none;
}

@media print {
  @page {
    size: landscape;
    margin: 1.5cm;
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  body {
    font-family: Georgia, 'Times New Roman', serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  aside,
  header,
  .toast-shell,
  .modal-overlay,
  .inventory-action-group,
  .history-action-group,
  .btn-primary,
  .btn-secondary,
  .btn-edit,
  .btn-delete,
  .form-input,
  .form-select,
  .form-label,
  .inventory-form-card,
  .kpi-card,
  .kpi-icon-wrap,
  .empty-state,
  .sales-panel,
  .empty-state-icon,
  .empty-state-subtitle,
  .empty-state-title,
  .animate-pulse,
  .sidebar-item,
  .sidebar-item-active {
    display: none !important;
  }

  main > section:first-of-type {
    display: none !important;
  }

  .print-header {
    display: block !important;
  }

  .print-footer {
    display: block !important;
    position: fixed;
    right: 1.5cm;
    bottom: 1.1cm;
    color: #4b5563;
    font-size: 0.78rem;
  }

  .print-footer::after {
    content: 'Página ' counter(page);
  }

  .card-surface,
  .table-shell {
    border-color: #d1d5db !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  .inventory-table-card,
  .history-table-card {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }

  .inventory-table-card th:last-child,
  .inventory-table-card td:last-child,
  .history-table-card th:last-child,
  .history-table-card td:last-child,
  .table-grid button,
  .pending-delete-badge,
  .toast-action {
    display: none !important;
  }

  .table-head th {
    background: #ffffff !important;
    color: #000000 !important;
    border-bottom: 1px solid #d1d5db !important;
  }

  .table-row,
  .table-row-low,
  .table-row:nth-child(even) {
    background: #ffffff !important;
  }

  .table-row td,
  .table-head th,
  .table-shell td,
  .table-shell th {
    color: #000000 !important;
    border-color: #d1d5db !important;
  }

  .table-shell {
    overflow: visible !important;
  }

  .table-grid table {
    min-width: 0 !important;
  }
}
