:root,
:root[data-theme="dark"] {
  --portal-bg: #23272b;
  --portal-bg-top: #2a3036;
  --portal-text: #e8edf2;
  --portal-text-strong: #f4f7ea;
  --portal-text-soft: #d7dee8;
  --portal-muted: #8da0ad;
  --portal-link: #d6e7ff;
  --portal-link-hover: #ffffff;
  --portal-surface: #2f343a;
  --portal-surface-elevated: rgba(255, 255, 255, 0.05);
  --portal-surface-soft: rgba(255, 255, 255, 0.03);
  --portal-surface-muted: rgba(255, 255, 255, 0.02);
  --portal-border: #3d4652;
  --portal-border-strong: #4b5561;
  --portal-shadow: rgba(0, 0, 0, 0.24);
  --portal-accent: #8f9b6b;
  --portal-accent-strong: #7c885d;
  --portal-accent-contrast: #1f231b;
  --portal-accent-rgb: 143, 155, 107;
  --portal-input-bg: rgba(255, 255, 255, 0.96);
  --portal-input-text: #1f252b;
  --portal-input-border: #cfd6dd;
  --portal-placeholder: #6b7681;
  --portal-table-bg: #2f343a;
  --portal-table-head-bg: rgba(255, 255, 255, 0.03);
  --portal-table-row-alt: rgba(255, 255, 255, 0.018);
  --portal-table-hover: rgba(255, 255, 255, 0.02);
  --portal-table-hover-border: rgba(var(--portal-accent-rgb), 0.3);
  --portal-success-soft: rgba(40, 167, 69, 0.24);
  --portal-success-text: #b8f0c5;
  --portal-danger-soft: rgba(220, 53, 69, 0.22);
  --portal-danger-text: #ffc1c7;
  --portal-neutral-soft: rgba(255, 255, 255, 0.1);
  --portal-neutral-text: #d5dbe3;
  --portal-warning-soft: rgba(255, 193, 7, 0.12);
  --portal-warning-text: #f4df9d;
}

:root[data-theme="light"] {
  --portal-bg: #f4f1e9;
  --portal-bg-top: #faf8f2;
  --portal-text: #2e3943;
  --portal-text-strong: #243038;
  --portal-text-soft: #4a5967;
  --portal-muted: #677481;
  --portal-link: #456173;
  --portal-link-hover: #273f50;
  --portal-surface: #ffffff;
  --portal-surface-elevated: rgba(255, 255, 255, 0.88);
  --portal-surface-soft: rgba(255, 255, 255, 0.72);
  --portal-surface-muted: rgba(248, 246, 241, 0.96);
  --portal-border: #d2d8de;
  --portal-border-strong: #bcc5cd;
  --portal-shadow: rgba(39, 53, 64, 0.1);
  --portal-accent: #788658;
  --portal-accent-strong: #66744a;
  --portal-accent-contrast: #fdfcf7;
  --portal-accent-rgb: 120, 134, 88;
  --portal-input-bg: #ffffff;
  --portal-input-text: #243038;
  --portal-input-border: #c8d0d7;
  --portal-placeholder: #85919c;
  --portal-table-bg: #ffffff;
  --portal-table-head-bg: #f1f4f6;
  --portal-table-row-alt: #fafbfc;
  --portal-table-hover: #f7f8f2;
  --portal-table-hover-border: rgba(var(--portal-accent-rgb), 0.24);
  --portal-success-soft: rgba(25, 135, 84, 0.1);
  --portal-success-text: #1f6a45;
  --portal-danger-soft: rgba(220, 53, 69, 0.1);
  --portal-danger-text: #9f3040;
  --portal-neutral-soft: rgba(113, 128, 150, 0.12);
  --portal-neutral-text: #556474;
  --portal-warning-soft: rgba(255, 193, 7, 0.18);
  --portal-warning-text: #8f6d10;
}

body.portal-theme-enabled {
  background: linear-gradient(180deg, var(--portal-bg-top), var(--portal-bg));
  color: var(--portal-text);
  min-height: 100vh;
  padding-left: 0;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: medium;
  transition: background-color 0.18s ease, color 0.18s ease;
}

body.portal-theme-enabled main {
  padding: 0 1rem 1.75rem;
}

body.portal-theme-enabled a {
  color: var(--portal-link);
  transition: color 0.18s ease;
}

body.portal-theme-enabled a:hover,
body.portal-theme-enabled a:focus {
  color: var(--portal-link-hover);
}

body.portal-theme-enabled .text-muted {
  color: var(--portal-muted) !important;
}

body.portal-theme-enabled .text-light {
  color: var(--portal-text-strong) !important;
}

body.portal-theme-enabled .form-control,
body.portal-theme-enabled .custom-select,
body.portal-theme-enabled .portal-search-shell input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
body.portal-theme-enabled .portal-search-shell textarea,
body.portal-theme-enabled .portal-search-shell select,
body.portal-theme-enabled .portal-detail-shell input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
body.portal-theme-enabled .portal-detail-shell textarea,
body.portal-theme-enabled .portal-detail-shell select,
body.portal-theme-enabled .article-finder-shell input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
body.portal-theme-enabled .article-finder-shell textarea,
body.portal-theme-enabled .article-finder-shell select {
  width: 100%;
  max-width: 100%;
}

body.portal-theme-enabled .form-control,
body.portal-theme-enabled .custom-select,
body.portal-theme-enabled .portal-search-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.btn),
body.portal-theme-enabled .portal-search-shell textarea,
body.portal-theme-enabled .portal-search-shell select,
body.portal-theme-enabled .portal-detail-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.btn),
body.portal-theme-enabled .portal-detail-shell textarea,
body.portal-theme-enabled .portal-detail-shell select,
body.portal-theme-enabled .article-finder-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.btn),
body.portal-theme-enabled .article-finder-shell textarea,
body.portal-theme-enabled .article-finder-shell select {
  background: var(--portal-input-bg);
  border: 1px solid var(--portal-input-border);
  color: var(--portal-input-text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

body.portal-theme-enabled .form-control::placeholder,
body.portal-theme-enabled .portal-search-shell textarea::placeholder,
body.portal-theme-enabled .portal-detail-shell textarea::placeholder,
body.portal-theme-enabled .article-finder-shell textarea::placeholder {
  color: var(--portal-placeholder);
}

:root[data-theme="dark"] body.portal-theme-enabled input[type="date"],
:root[data-theme="dark"] body.portal-theme-enabled input[type="month"] {
  color-scheme: dark;
}

:root[data-theme="dark"] body.portal-theme-enabled input[type="date"]::-webkit-datetime-edit,
:root[data-theme="dark"] body.portal-theme-enabled input[type="month"]::-webkit-datetime-edit {
  color: var(--portal-input-text);
}

:root[data-theme="dark"] body.portal-theme-enabled input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] body.portal-theme-enabled input[type="month"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(1) brightness(0.85);
  opacity: 0.82;
}

:root[data-theme="dark"] body.portal-theme-enabled input[type="date"]::-webkit-calendar-picker-indicator:hover,
:root[data-theme="dark"] body.portal-theme-enabled input[type="month"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(1) brightness(1);
  opacity: 0.96;
}

body.portal-theme-enabled .form-control:focus,
body.portal-theme-enabled .custom-select:focus,
body.portal-theme-enabled .portal-search-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.btn):focus,
body.portal-theme-enabled .portal-search-shell textarea:focus,
body.portal-theme-enabled .portal-search-shell select:focus,
body.portal-theme-enabled .portal-detail-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.btn):focus,
body.portal-theme-enabled .portal-detail-shell textarea:focus,
body.portal-theme-enabled .portal-detail-shell select:focus,
body.portal-theme-enabled .article-finder-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.btn):focus,
body.portal-theme-enabled .article-finder-shell textarea:focus,
body.portal-theme-enabled .article-finder-shell select:focus {
  background: var(--portal-input-bg);
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 0.18rem rgba(var(--portal-accent-rgb), 0.18);
  color: var(--portal-input-text);
}

body.portal-theme-enabled .btn-primary,
body.portal-theme-enabled .btn-success {
  background-color: var(--portal-accent);
  border-color: var(--portal-accent);
  color: var(--portal-accent-contrast);
}

body.portal-theme-enabled .btn-primary:hover,
body.portal-theme-enabled .btn-primary:focus,
body.portal-theme-enabled .btn-success:hover,
body.portal-theme-enabled .btn-success:focus {
  background-color: var(--portal-accent-strong);
  border-color: var(--portal-accent-strong);
  color: var(--portal-accent-contrast);
  box-shadow: none;
}

body.portal-theme-enabled .btn-outline-primary {
  border-color: rgba(var(--portal-accent-rgb), 0.46);
  color: var(--portal-accent);
}

body.portal-theme-enabled .btn-outline-primary:hover,
body.portal-theme-enabled .btn-outline-primary:focus {
  background: rgba(var(--portal-accent-rgb), 0.12);
  border-color: var(--portal-accent);
  color: var(--portal-accent-strong);
}

body.portal-theme-enabled .btn-outline-light {
  border-color: var(--portal-border-strong);
  color: var(--portal-text-soft);
}

body.portal-theme-enabled .btn-outline-light:hover,
body.portal-theme-enabled .btn-outline-light:focus {
  background: var(--portal-surface-soft);
  border-color: var(--portal-border-strong);
  color: var(--portal-text-strong);
}

body.portal-theme-enabled .alert-primary {
  background: rgba(var(--portal-accent-rgb), 0.12);
  border-color: rgba(var(--portal-accent-rgb), 0.28);
  color: var(--portal-text);
}

body.portal-theme-enabled .alert-warning {
  background: var(--portal-warning-soft);
  border-color: rgba(255, 193, 7, 0.28);
  color: var(--portal-warning-text);
}

body.portal-theme-enabled .alert-danger {
  background: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.24);
  color: #f2c0c8;
}

:root[data-theme="light"] body.portal-theme-enabled .alert-danger {
  color: #9f3040;
}

body.portal-theme-enabled .messages {
  margin: 0;
  padding-left: 1.1rem;
}

body.portal-theme-enabled .table {
  color: var(--portal-text);
}

body.portal-theme-enabled .table td,
body.portal-theme-enabled .table th,
body.portal-theme-enabled .table thead th,
body.portal-theme-enabled .table-bordered td,
body.portal-theme-enabled .table-bordered th {
  border-color: var(--portal-border);
}

body.portal-theme-enabled .table thead th {
  background: var(--portal-table-head-bg);
  color: var(--portal-text-soft);
}

body.portal-theme-enabled .table-dark,
body.portal-theme-enabled .table-dark > th,
body.portal-theme-enabled .table-dark > td {
  background-color: var(--portal-table-bg);
  color: var(--portal-text);
}

body.portal-theme-enabled .table-dark th,
body.portal-theme-enabled .table-dark td,
body.portal-theme-enabled .table-dark thead th {
  border-color: var(--portal-border);
}

body.portal-theme-enabled .table-dark.table-striped tbody tr:nth-of-type(odd),
body.portal-theme-enabled .table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--portal-table-row-alt);
}

body.portal-theme-enabled .table-hover tbody tr:hover,
body.portal-theme-enabled .table-dark.table-hover tbody tr:hover,
body.portal-theme-enabled .table-dark tbody tr:hover {
  background-color: var(--portal-table-hover);
  color: var(--portal-text-strong);
}

body.portal-theme-enabled .page-link {
  background-color: var(--portal-surface);
  border-color: var(--portal-border);
  color: var(--portal-link);
}

body.portal-theme-enabled .page-link:hover {
  background-color: rgba(var(--portal-accent-rgb), 0.14);
  border-color: rgba(var(--portal-accent-rgb), 0.4);
  color: var(--portal-link-hover);
}

body.portal-theme-enabled .page-item.disabled .page-link {
  background-color: var(--portal-surface);
  border-color: var(--portal-border);
  color: var(--portal-muted);
}

body.portal-theme-enabled .page-item.active .page-link {
  background-color: var(--portal-accent);
  border-color: var(--portal-accent);
  color: var(--portal-accent-contrast);
}

body.portal-theme-enabled .div_comprobantes_by_sku_res,
body.portal-theme-enabled .divstk,
body.portal-theme-enabled .tablecontainer {
  background: var(--portal-surface-soft);
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  box-shadow: 0 12px 24px var(--portal-shadow);
  padding: 0.9rem;
}

body.portal-theme-enabled .stkdetaArt {
  background: var(--portal-surface-soft);
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  box-shadow: 0 12px 24px var(--portal-shadow);
  margin-bottom: 1rem;
  padding: 1rem;
}

body.portal-theme-enabled .fmDetArt {
  color: var(--portal-muted);
  margin-bottom: 0.85rem;
  margin-top: 0.85rem;
}

body.portal-theme-enabled .modal-content {
  color: var(--portal-text);
}

body.portal-theme-enabled .portal-results-shell,
body.portal-theme-enabled .portal-detail-shell {
  background: linear-gradient(180deg, var(--portal-surface-elevated), transparent);
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  box-shadow: 0 16px 32px var(--portal-shadow);
  margin-top: 1rem;
  padding: 1rem 1.1rem;
}

body.portal-theme-enabled .portal-results-header,
body.portal-theme-enabled .portal-detail-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

body.portal-theme-enabled .portal-results-heading,
body.portal-theme-enabled .portal-detail-heading {
  color: var(--portal-text-strong);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

body.portal-theme-enabled .portal-results-subtitle,
body.portal-theme-enabled .portal-detail-subtitle {
  color: var(--portal-muted);
  font-size: 0.82rem;
  margin: 0.2rem 0 0;
}

body.portal-theme-enabled .portal-results-meta,
body.portal-theme-enabled .portal-inline-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

body.portal-theme-enabled .portal-results-chip {
  align-items: center;
  background: rgba(var(--portal-accent-rgb), 0.14);
  border: 1px solid rgba(var(--portal-accent-rgb), 0.34);
  border-radius: 999px;
  color: var(--portal-text-soft);
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 0.3rem;
  justify-content: center;
  line-height: 1.15;
  padding: 0.28rem 0.8rem;
}

body.portal-theme-enabled .portal-results-chip strong {
  color: var(--portal-text-strong);
}

body.portal-theme-enabled .portal-results-shell .table,
body.portal-theme-enabled .portal-detail-shell .table {
  margin-bottom: 0;
}

body.portal-theme-enabled .portal-empty-state {
  background: var(--portal-surface-muted);
  border: 1px dashed var(--portal-border);
  border-radius: 12px;
  color: var(--portal-muted);
  padding: 1rem;
  text-align: center;
}

body.portal-theme-enabled .portal-detail-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 0.85rem;
}

body.portal-theme-enabled .portal-detail-card {
  background: var(--portal-surface-soft);
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

body.portal-theme-enabled .portal-detail-card h6 {
  color: var(--portal-text-strong);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.55rem;
  text-transform: uppercase;
}

body.portal-theme-enabled .portal-detail-card p:last-child,
body.portal-theme-enabled .portal-detail-card ul:last-child,
body.portal-theme-enabled .portal-detail-card .table:last-child {
  margin-bottom: 0;
}

body.portal-theme-enabled .portal-detail-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

body.portal-theme-enabled .portal-detail-item {
  align-items: baseline;
  border-bottom: 1px solid var(--portal-border);
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  padding-bottom: 0.4rem;
}

body.portal-theme-enabled .portal-detail-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

body.portal-theme-enabled .portal-detail-item strong {
  color: var(--portal-text-soft);
  flex: 0 0 auto;
  font-size: 0.82rem;
}

body.portal-theme-enabled .portal-detail-item span {
  color: var(--portal-text);
  flex: 1 1 auto;
  text-align: right;
}

body.portal-theme-enabled .portal-detail-card .table thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
}

body.portal-theme-enabled .portal-section {
  margin-top: 1rem;
}

body.portal-theme-enabled .portal-home-shell {
  background: linear-gradient(180deg, var(--portal-surface-elevated), transparent);
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  box-shadow: 0 16px 32px var(--portal-shadow);
  margin-top: 1rem;
  padding: 1rem 1.1rem;
}

body.portal-theme-enabled .portal-home-header {
  margin-bottom: 0.9rem;
}

body.portal-theme-enabled .portal-home-title {
  color: var(--portal-text-strong);
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0;
}

body.portal-theme-enabled .portal-home-subtitle {
  color: var(--portal-muted);
  font-size: 0.84rem;
  margin: 0.25rem 0 0;
}

body.portal-theme-enabled .portal-home-links {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body.portal-theme-enabled .portal-home-link {
  background: var(--portal-surface-soft);
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  color: var(--portal-text);
  display: block;
  padding: 0.95rem 1rem;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

body.portal-theme-enabled .portal-home-link strong {
  color: var(--portal-text-strong);
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.18rem;
}

body.portal-theme-enabled .portal-home-link span {
  color: var(--portal-muted);
  display: block;
  font-size: 0.8rem;
}

body.portal-theme-enabled .portal-home-link:hover,
body.portal-theme-enabled .portal-home-link:focus {
  background: rgba(var(--portal-accent-rgb), 0.12);
  border-color: rgba(var(--portal-accent-rgb), 0.34);
  color: var(--portal-text-strong);
  text-decoration: none;
  transform: translateY(-1px);
}

@media (max-width: 767px) {
  body.portal-theme-enabled .portal-results-shell,
  body.portal-theme-enabled .portal-detail-shell {
    padding: 0.85rem;
  }

  body.portal-theme-enabled .portal-detail-item {
    align-items: flex-start;
    flex-direction: column;
  }

  body.portal-theme-enabled .portal-detail-item span {
    text-align: left;
  }
}

body.portal-theme-enabled .tablecontainer .table {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  body.portal-theme-enabled main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  body.portal-theme-enabled .div_comprobantes_by_sku_res,
  body.portal-theme-enabled .divstk,
  body.portal-theme-enabled .tablecontainer,
  body.portal-theme-enabled .stkdetaArt {
    padding: 0.75rem;
  }
}
