/* POS Campo */
:root {
  --ps-primary: #3f6212;
  --ps-primary-dark: #1a2e05;
  --ps-accent: #65a30d;
  --ps-accent-soft: #d9f99d;
  --ps-sidebar: #1a2e05;
  --ps-sidebar-hover: #365314;
  --ps-surface: #ffffff;
  --ps-card: #ffffff;
  --ps-text: #1c2b16;
  --ps-muted: #4d7c0f;
  --ps-border: #d9f0c2;
  --ps-radius: 12px;
  --ps-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --ps-font: "Source Sans 3", "Segoe UI", sans-serif;
}

html,
body {
  font-family: var(--ps-font);
  color: var(--ps-text);
  background: var(--ps-surface);
}

body:not(.login-page) {
  background: var(--ps-surface);
}

/* Layout */
.content-wrapper {
  background: transparent !important;
}

.content-header {
  background: #ecfccb !important;
  border-radius: 0 0 var(--ps-radius) var(--ps-radius);
  margin: 0 0 1rem;
  padding: 1rem 1.25rem !important;
  box-shadow: var(--ps-shadow);
}

.content-header h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: #1a2e05;
}

.content-header h1 small,
.content-header h1 .text-muted {
  color: #3f6212 !important;
  font-weight: 500;
  font-size: 0.85em;
}

/* Navbar */
.main-header.navbar {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ps-border) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  min-height: 56px;
}

.main-header .nav-link {
  color: var(--ps-text) !important;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.main-header .nav-link:hover {
  background: #f1f5f9 !important;
  color: var(--ps-primary) !important;
}

.ps-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem !important;
  background: #f8fafc;
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.ps-user-chip .ps-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ps-primary), var(--ps-accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.dropdown-menu {
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  box-shadow: var(--ps-shadow);
  padding: 0.4rem;
}

.dropdown-item {
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
}

.dropdown-item:hover {
  background: #ecfeff;
  color: var(--ps-primary-dark);
}

/* Sidebar brand */
.main-sidebar {
  background: var(--ps-sidebar) !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.brand-link {
  background: #0b1220 !important;
  border-bottom: 1px solid #1f2937 !important;
  padding: 0.9rem 1rem !important;
}

.brand-link .brand-text {
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}

/* Cards & tables */
.card {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);
  overflow: hidden;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--ps-border);
  font-weight: 600;
}

.card-primary:not(.card-outline) > .card-header,
.card-info:not(.card-outline) > .card-header,
.card-success:not(.card-outline) > .card-header {
  background: linear-gradient(135deg, var(--ps-primary), var(--ps-accent));
  border: 0;
}

.table {
  color: var(--ps-text);
}

.table thead th {
  border-top: 0;
  border-bottom: 2px solid var(--ps-border);
  color: var(--ps-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  background: #f8fafc;
  white-space: nowrap;
}

.table-hover tbody tr {
  transition: background 0.15s ease;
}

.table-hover tbody tr:hover {
  background: #f0fdfa !important;
}

/* Listados: mismo criterio que la tabla de productos. Los catálogos de carga no usan esta clase. */
.ps-lista,
.ps-lista th,
.ps-lista td {
  border: 0 !important;
  vertical-align: middle;
}

.ps-lista th,
.ps-lista td {
  text-align: left !important;
}

.ps-lista thead th {
  background: transparent !important;
  border-bottom: 2px solid var(--ps-border) !important;
  color: #3f6212;
}

.ps-lista tbody td {
  border-bottom: 1px solid #ecfccb !important;
}

.ps-lista tbody tr:nth-of-type(odd),
.ps-lista.table-striped tbody tr:nth-of-type(odd) {
  background: transparent;
}

.ps-lista tbody tr:hover td {
  background: #f7fee7 !important;
}

.ps-lista td:has(.btn-group) {
  width: 1% !important;
  white-space: nowrap;
  text-align: center !important;
}

.ps-lista .btn-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
}

.ps-lista .btn-group > .btn {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  margin: 0;
  font-size: 1.05rem;
  border-radius: 8px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  float: none;
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-info,
.btn-primary {
  background: var(--ps-primary) !important;
  border-color: var(--ps-primary) !important;
}

.btn-info:hover,
.btn-primary:hover {
  background: var(--ps-primary-dark) !important;
  border-color: var(--ps-primary-dark) !important;
  box-shadow: 0 6px 16px rgba(14, 116, 144, 0.28);
}

.btn-success {
  background: #0d9488 !important;
  border-color: #0d9488 !important;
}

.btn-flat {
  border-radius: 8px !important;
}

/* Dashboard small boxes */
.small-box {
  border-radius: var(--ps-radius) !important;
  box-shadow: var(--ps-shadow) !important;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 0;
}

.small-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12) !important;
}

.small-box .inner h3 {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.small-box .icon {
  opacity: 0.18;
}

.small-box > .small-box-footer {
  background: rgba(0, 0, 0, 0.12);
  transition: background 0.2s ease;
}

.small-box:hover > .small-box-footer {
  background: rgba(0, 0, 0, 0.2);
}

.ps-box-agents {
  background: linear-gradient(135deg, #f59e0b, #f97316) !important;
}

.ps-box-products {
  background: linear-gradient(135deg, #ef4444, #f43f5e) !important;
}

.ps-box-shipments {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
}

.ps-box-month {
  background: linear-gradient(135deg, #14b8a6, #0d9488) !important;
}

/* DataTables */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 8px;
  border: 1px solid var(--ps-border);
  padding: 0.35rem 0.6rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--ps-primary) !important;
  border-color: var(--ps-primary) !important;
  color: #fff !important;
  border-radius: 8px;
}

div.dt-buttons .btn {
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

/* Forms */
.form-control {
  border-radius: 8px;
  border-color: var(--ps-border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--ps-accent);
  box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.18);
}

.input-group-text {
  border-radius: 8px;
  border-color: var(--ps-border);
  background: #f8fafc;
}

/* Footer */
.main-footer {
  background: transparent !important;
  border-top: 1px solid var(--ps-border) !important;
  color: var(--ps-muted);
  font-size: 0.875rem;
}

.main-footer a {
  color: var(--ps-primary);
  font-weight: 600;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(160deg, rgba(15, 23, 42, 0.72), rgba(14, 116, 144, 0.55)),
    url("../../img/plantilla/back.png") center / cover no-repeat !important;
}

.login-page .login-box {
  width: 100%;
  max-width: 420px;
  margin: 1.5rem;
}

.login-page .card {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.login-page .login-logo,
.login-page .login-logo b {
  margin-bottom: 1rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.login-page .login-logo img {
  max-width: 220px;
  width: 70%;
  height: auto;
  padding: 0 !important;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.login-card-body {
  padding: 1.75rem 1.5rem 1.5rem !important;
}

.login-box-msg {
  font-weight: 600;
  color: var(--ps-muted);
  margin-bottom: 1.25rem !important;
}

.login-page .btn-block {
  padding: 0.7rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

/* Welcome banner */
.ps-welcome {
  background: linear-gradient(135deg, #ecfeff, #f0fdfa);
  border: 1px solid #cffafe;
  border-radius: var(--ps-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ps-welcome-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ps-primary), var(--ps-accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ps-welcome h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.ps-welcome p {
  margin: 0.15rem 0 0;
  color: var(--ps-muted);
  font-size: 0.92rem;
}

a.ps-home-kpi {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.ps-home-kpi:hover {
  color: inherit;
  text-decoration: none;
  border-color: var(--ps-accent);
}

.ps-home-card {
  border: 1px solid var(--ps-border);
  box-shadow: var(--ps-shadow);
}

.ps-home-card > .card-header {
  background: #fff;
}

.ps-home-lista + .ps-home-lista {
  margin-top: 1rem;
}

.ps-home-lista-titulo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.ps-home-lista-titulo h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.ps-home-lista-titulo a {
  font-size: 0.85rem;
  font-weight: 600;
}

.ps-home-vacio {
  margin: 0.35rem 0 0;
  color: #4b5563;
  font-size: 0.9rem;
}

.ps-feed {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

.ps-feed li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--ps-border);
}

.ps-feed li:last-child {
  border-bottom: 0;
}

.ps-feed a {
  color: inherit;
  font-weight: 600;
}

.ps-feed small {
  display: block;
  color: #4b5563;
  font-weight: 400;
}

.ps-feed time {
  color: #4b5563;
  white-space: nowrap;
  font-size: 0.85rem;
}

.ps-home-danger {
  color: #b91c1c !important;
}

.ps-home-warning {
  color: #a16207 !important;
}

.ps-home-modulo h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0.25rem 0 0.2rem;
}

.ps-home-modulo > p {
  margin: 0 0 0.85rem;
  color: #3f6212;
}

/* Modal polish */
.modal-content {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.modal-header {
  border-bottom: 1px solid var(--ps-border);
  border-radius: 14px 14px 0 0;
}

.modal-footer {
  border-top: 1px solid var(--ps-border);
}

/* Smooth page feel */
.sidebar .nav-link,
.section-button,
.small-box,
.btn,
.card {
  will-change: transform;
}

@media (max-width: 767.98px) {
  .content-header {
    border-radius: 0;
    margin-bottom: 0.75rem;
  }

  .ps-welcome {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==== REPORTES ==== */
.ps-report-toolbar {
  border: 1px solid var(--ps-border);
}

.ps-report-card {
  border: 1px solid var(--ps-border);
  box-shadow: var(--ps-shadow);
}

.ps-report-card > .card-header {
  background: #fff;
  border-bottom: 1px solid var(--ps-border);
  padding: 0.9rem 1.1rem;
}

.ps-report-card .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ps-text);
}

.ps-period-form .form-control {
  min-width: 160px;
}

.ps-chart-box {
  width: 100%;
  min-height: 250px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem;
}

.ps-chart-empty {
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ps-muted);
  text-align: center;
  padding: 1.5rem;
}

.ps-chart-empty i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.45;
  color: var(--ps-primary);
}

.ps-chart-empty p {
  margin: 0;
  font-weight: 500;
}

.ps-chart-scroll {
  position: relative;
  height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.ps-chart-scroll::-webkit-scrollbar {
  width: 8px;
}

.ps-chart-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 8px;
}

.ps-report-anclas {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.55rem;
  margin: 0 0 1rem;
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  box-shadow: var(--ps-shadow);
}

.ps-report-anclas a {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ps-text);
  background: #f4f7ef;
  border: 1px solid var(--ps-border);
  white-space: nowrap;
}

.ps-report-anclas a:hover,
.ps-report-anclas a.activo {
  background: var(--ps-primary);
  border-color: var(--ps-primary);
  color: #fff;
  text-decoration: none;
}

html.tema-noche .ps-report-anclas a {
  background: #2a332e;
  color: #e6ebe7;
  border-color: #4a564e;
}

html.tema-noche .ps-report-anclas a:hover,
html.tema-noche .ps-report-anclas a.activo {
  background: var(--ps-primary);
  color: #fff;
}

.ps-report-ancla {
  scroll-margin-top: 4.4rem;
}

.ps-report-bloque {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  padding: 0.35rem 1rem 0.35rem;
  margin-bottom: 1.35rem;
}

.ps-report-seccion {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid var(--ps-border);
}

.ps-report-seccion h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ps-text);
}

.ps-report-seccion p,
.ps-report-nota {
  margin: 0.25rem 0 0.75rem;
  color: var(--ps-muted);
  font-size: 0.92rem;
}

.ps-report-acciones {
  gap: 0.5rem;
}

.ps-kpi {
  height: 100%;
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  box-shadow: var(--ps-shadow);
  padding: 0.9rem 1rem;
}

.ps-kpi i {
  color: var(--ps-primary);
  font-size: 1.05rem;
}

.ps-kpi strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.55rem;
  line-height: 1.15;
  color: var(--ps-text);
}

.ps-kpi span {
  display: block;
  margin-top: 0.15rem;
  color: var(--ps-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.ps-chart-box {
  overflow-x: auto;
}

/* Morris tooltip polish */
.morris-hover.morris-default-style {
  border-radius: 8px !important;
  border: 1px solid var(--ps-border) !important;
  box-shadow: var(--ps-shadow) !important;
  font-family: var(--ps-font) !important;
}

.ps-tema-btn {
  color: var(--ps-primary) !important;
  font-size: 1.05rem;
  padding: 0.35rem 0.7rem !important;
}

.main-header.navbar {
  display: flex;
  align-items: center;
}

.ps-avisos {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  overflow: visible;
  margin: 0 0.75rem;
}

.main-header .navbar-nav {
  flex-shrink: 0;
}

.ps-avisos-menu {
  display: none;
  position: fixed;
  z-index: 5000;
  min-width: 280px;
  max-width: 420px;
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  box-shadow: var(--ps-shadow);
  padding: 0.45rem;
}

.ps-avisos-menu.abierto {
  display: block;
}

button.ps-aviso {
  border: 0;
  cursor: pointer;
}

.ps-aviso-item {
  display: block;
  width: 100%;
  white-space: normal;
  border-radius: 8px;
  margin: 0 0 0.4rem;
  padding: 0.55rem 0.75rem;
  line-height: 1.35;
  text-decoration: none !important;
}

.ps-aviso-item:last-child {
  margin-bottom: 0;
}

#btnAvisosMas {
  flex: 0 0 auto;
  max-width: none;
  font-weight: 700;
}

.ps-filtro-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ps-filtro-bar select {
  width: auto;
  min-width: 190px;
}

.ps-fila-aviso td {
  box-shadow: inset 3px 0 0 #9a3412;
}

.ps-aviso {
  flex: 0 1 220px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  text-decoration: none !important;
}

.ps-avisos .dropdown {
  flex: 0 0 auto;
}

.ps-avisos .dropdown .ps-aviso {
  flex: 0 0 auto;
  max-width: none;
}

.ps-aviso-danger {
  background: #f3d6d2;
  color: #7a2e2a !important;
}

.ps-aviso-warning {
  background: #f3e6c8;
  color: #6b4e16 !important;
}

.ps-aviso-info {
  background: #dce8df;
  color: #2c4a34 !important;
}

html.tema-noche {
  --ps-primary: #8aa584;
  --ps-primary-dark: #c5d4c4;
  --ps-accent: #6f8f78;
  --ps-accent-soft: #3a463d;
  --ps-sidebar: #232a26;
  --ps-sidebar-hover: #3d4942;
  --ps-surface: #2a312c;
  --ps-card: #343d37;
  --ps-text: #e6ebe7;
  --ps-muted: #b7c2b8;
  --ps-border: #4a564e;
}

html.tema-noche body:not(.login-page),
html.tema-noche .content-wrapper,
html.tema-noche .wrapper {
  background: #2a312c !important;
  color: #e6ebe7;
}

html.tema-noche .main-header.navbar {
  background: #2e3832 !important;
  border-bottom: 1px solid #4a564e !important;
}

html.tema-noche .main-header .nav-link,
html.tema-noche .main-header .nav-link span,
html.tema-noche .ps-tema-btn,
html.tema-noche .text-muted {
  color: #e6ebe7 !important;
}

html.tema-noche .main-header .nav-link:hover {
  background: #3d4942 !important;
  color: #f4f7f4 !important;
}

html.tema-noche .content-header {
  background: #3a463d !important;
}

html.tema-noche .content-header h1,
html.tema-noche .content-header h1 small,
html.tema-noche .content-header h1 .text-muted {
  color: #e6ebe7 !important;
}

html.tema-noche .card,
html.tema-noche .modal-content,
html.tema-noche .dropdown-menu,
html.tema-noche .table,
html.tema-noche .dataTables_wrapper,
html.tema-noche .login-card-body {
  background: #343d37 !important;
  color: #e6ebe7 !important;
  border-color: #4a564e !important;
}

html.tema-noche .table th,
html.tema-noche .table td,
html.tema-noche .dataTables_wrapper .dataTables_info,
html.tema-noche .dataTables_wrapper .dataTables_length,
html.tema-noche .dataTables_wrapper .dataTables_filter,
html.tema-noche label {
  color: #e6ebe7 !important;
  background-color: transparent;
  border-color: #4a564e !important;
}

html.tema-noche .table-striped tbody tr:nth-of-type(odd) {
  background: #3a443d !important;
}

html.tema-noche .ps-lista thead th {
  color: #d5ddd6 !important;
  border-bottom-color: #4a564e !important;
}

html.tema-noche .ps-lista tbody td {
  border-bottom-color: #4a564e !important;
}

html.tema-noche .ps-lista tbody tr:hover td {
  background: #3a443d !important;
}

html.tema-noche .main-sidebar,
html.tema-noche .main-sidebar .sidebar {
  background: #232a26 !important;
}

html.tema-noche .brand-link {
  background: #1e2522 !important;
  border-bottom: 1px solid #4a564e !important;
}

html.tema-noche .brand-link,
html.tema-noche .brand-text {
  color: #e6ebe7 !important;
}

html.tema-noche .main-footer {
  background: #2e3832 !important;
  color: #b7c2b8 !important;
  border-top: 1px solid #4a564e !important;
}

html.tema-noche .card-header,
html.tema-noche .ps-report-card > .card-header,
html.tema-noche .ps-home-card > .card-header,
html.tema-noche .ps-report-bloque,
html.tema-noche .ps-report-anclas,
html.tema-noche .ps-kpi,
html.tema-noche .card-primary:not(.card-outline) > .card-header,
html.tema-noche .card-info:not(.card-outline) > .card-header,
html.tema-noche .card-success:not(.card-outline) > .card-header,
html.tema-noche .ps-chart-box,
html.tema-noche .ps-chart-scroll,
html.tema-noche .products-list > .item,
html.tema-noche .page-link,
html.tema-noche .dataTables_wrapper .dataTables_filter input,
html.tema-noche .dataTables_wrapper .dataTables_length select,
html.tema-noche .custom-select,
html.tema-noche .form-control,
html.tema-noche .select2-selection,
html.tema-noche .ps-user-chip {
  background: #3a443d !important;
  color: #e6ebe7 !important;
  border-color: #4a564e !important;
}

html.tema-noche .ps-chart-box text,
html.tema-noche .ps-chart-box tspan {
  fill: #d5ddd6 !important;
}

html.tema-noche .ps-chart-box svg rect {
  fill: #6f8f78 !important;
}

html.tema-noche .content-header .text-dark {
  color: #e6ebe7 !important;
}

html.tema-noche .products-list > .item {
  border-bottom: 1px solid #4a564e;
}

html.tema-noche a {
  color: #c5d4c4;
}

html.tema-noche a:hover {
  color: #f4f7f4;
}

html.tema-noche .page-item.active .page-link,
html.tema-noche .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #4d5c52 !important;
  border-color: #6f8f78 !important;
  color: #f4f7f4 !important;
}

html.tema-noche .ps-box-agents {
  background: #8a6a3b !important;
}

html.tema-noche .ps-box-products {
  background: #8a4e4a !important;
}

html.tema-noche .ps-box-shipments {
  background: #3d6270 !important;
}

html.tema-noche .ps-box-month {
  background: #3f6b62 !important;
}

html.tema-noche .dropdown-item:hover {
  background: #3d4942;
  color: #f4f7f4;
}

html.tema-noche .ps-aviso-danger {
  background: #5c403c;
  color: #f3e4e1 !important;
}

html.tema-noche .ps-aviso-warning {
  background: #5c5140;
  color: #f4ead6 !important;
}

html.tema-noche .ps-aviso-info {
  background: #3d4a42;
  color: #e4eee6 !important;
}

html.tema-noche .ps-avisos-menu {
  background: #343d37;
  border-color: #4a564e;
  color: #e6ebe7;
}

.cfg-intro {
  margin: 0.45rem 0 0;
  color: #3f6212;
}

.cfg-grupo {
  margin: 0.4rem 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3f6212;
}

.cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cfg-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--ps-card);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--ps-shadow);
  color: var(--ps-text);
  min-height: 148px;
  text-decoration: none;
}

.cfg-card:hover {
  text-decoration: none;
  border-color: var(--ps-accent);
  color: var(--ps-text);
}

.cfg-card > i {
  color: var(--ps-primary);
  font-size: 1.25rem;
}

.cfg-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.25rem 0 0;
}

.cfg-card p {
  margin: 0;
  color: #4b5563;
  font-size: 0.92rem;
}

.cfg-soon {
  opacity: 0.7;
}

html.tema-noche .cfg-card {
  background: #343d37;
  border-color: #4a564e;
  color: #e6ebe7;
}

html.tema-noche .cfg-card p,
html.tema-noche .cfg-grupo,
html.tema-noche .cfg-intro {
  color: #c5d0c8;
}

html.tema-noche .cfg-card:hover {
  color: #f4f7f4;
  border-color: #6f8f78;
}

html.tema-noche .ps-welcome {
  background: #2e3832;
  border-color: #4a564e;
}

html.tema-noche .ps-welcome h3,
html.tema-noche .ps-feed a,
html.tema-noche .ps-home-modulo h2 {
  color: #e6ebe7;
}

html.tema-noche .ps-welcome p,
html.tema-noche .ps-home-modulo > p,
html.tema-noche .ps-home-vacio,
html.tema-noche .ps-feed small,
html.tema-noche .ps-feed time {
  color: #c5d0c8;
}

html.tema-noche .ps-feed li {
  border-bottom-color: #4a564e;
}

html.tema-noche .ps-home-danger {
  color: #f0b4b4 !important;
}

html.tema-noche .ps-home-warning {
  color: #f3d48a !important;
}

.cfg-rapida {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.cfg-rapida-item {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--ps-border);
  background: #fff;
  color: var(--ps-primary);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.cfg-rapida-item:hover,
.cfg-rapida-item.activo {
  background: var(--ps-primary);
  border-color: var(--ps-primary);
  color: #fff;
  text-decoration: none;
}

.cfg-icono-previa {
  height: 48px;
  width: 48px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--ps-border);
  background: #fff;
}

.cfg-permisos-grupo td {
  background: #ecfccb;
  font-weight: 700;
}

html.tema-noche .cfg-rapida-item {
  background: #343d37;
  border-color: #4a564e;
  color: #e6ebe7;
}

html.tema-noche .cfg-rapida-item.activo,
html.tema-noche .cfg-rapida-item:hover {
  background: #4d5c52;
  color: #f4f7f4;
}

html.tema-noche .cfg-permisos-grupo td {
  background: #3d4942;
  color: #f4f7f4;
}

.ps-ayuda-nav {
  color: var(--ps-primary);
  font-weight: 700;
}

.ps-ayuda-lista {
  padding-left: 1.15rem;
}

.ps-ayuda-lista li + li {
  margin-top: 0.45rem;
}

html.tema-noche .ps-ayuda-nav {
  color: #d9f99d;
}

.ps-filtros-accion {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

html.tema-noche .ps-filtro-accion.btn-outline-secondary {
  color: #e6ebe7;
  border-color: #6b7a70;
}

/* Categorías, campos y depósitos */
.ps-hub-intro {
  margin: 0.35rem 0 0;
  max-width: 42rem;
  color: #3f6212;
  font-size: 1rem;
}

.ps-hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.ps-hub-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--ps-border);
  background: #fff;
  color: var(--ps-primary);
  font-weight: 700;
  text-decoration: none;
}

.ps-hub-tab span {
  min-width: 1.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #ecfccb;
  color: #1a2e05;
  font-size: 0.8rem;
  text-align: center;
}

.ps-hub-tab:hover {
  text-decoration: none;
  color: var(--ps-primary-dark);
  border-color: var(--ps-accent);
}

.ps-hub-tab.is-active,
.ps-hub-tab.is-active:hover {
  background: var(--ps-primary);
  border-color: var(--ps-primary);
  color: #fff;
}

.ps-hub-tab.is-active span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.ps-hub-alta,
.ps-hub-item {
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);
  padding: 0.95rem 1rem;
  margin-bottom: 0.8rem;
}

.ps-hub-alta-grid,
.ps-hub-lote-alta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: flex-end;
}

.ps-hub-alta-grid > label,
.ps-hub label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.ps-hub-alta-grid > label {
  flex: 1 1 12rem;
}

.ps-hub-alta-grid > label:nth-child(2) {
  flex: 0.5 1 7rem;
}

.ps-hub-alta-grid > .btn,
.ps-hub-lote-alta > .btn {
  min-height: 2.5rem;
}

.ps-hub-lote-alta > .form-control {
  flex: 1 1 12rem;
}

.ps-hub-lote-alta > .form-control[name="nuevoLoteSuperficie"] {
  flex: 0 1 6rem;
}

.ps-hub-lote-alta > input[type="hidden"] {
  display: none;
}

.ps-hub-punto {
  flex: 1 1 100%;
  width: 100%;
  margin-top: 0.75rem;
}

.ps-hub-punto p,
.ps-hub-nota,
.ps-hub-notas,
.ps-hub-vacio,
.ps-hub-conteo {
  color: #3f6212;
  font-weight: 500;
}

.ps-hub-punto p,
.ps-hub-nota {
  margin: 0.35rem 0 0.6rem;
}

.ps-hub-punto-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.ps-hub-punto-grid label {
  flex: 1 1 9rem;
}

.ps-hub summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--ps-border);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.ps-hub summary::-webkit-details-marker {
  display: none;
}

.ps-hub details[open] > summary {
  border-color: var(--ps-accent);
  background: #f7fee7;
}

.ps-hub-buscar {
  max-width: 22rem;
  margin-bottom: 0.6rem;
}

.ps-hub-conteo {
  min-height: 1.2rem;
  margin: 0 0 0.4rem;
}

.ps-hub-item-main,
.ps-hub-acciones,
.ps-hub-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.45rem;
}

.ps-hub details:not([open]) > :not(summary) {
  display: none !important;
}

.ps-hub-acciones > details[open] {
  flex: 1 1 100%;
}

.ps-hub-item-main {
  justify-content: space-between;
}

.ps-hub-acciones {
  margin-top: 0.65rem;
}

.ps-hub-notas {
  margin: 0.15rem 0 0;
}

.ps-hub-badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 700;
}

.ps-hub-badge.is-ok {
  background: #d9f99d;
  color: #1a2e05;
}

.ps-hub-hijos {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--ps-border);
}

.ps-hub-hijos h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.ps-hub-hijo {
  margin: 0.45rem 0 0.45rem 0.35rem;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--ps-accent);
  border-radius: 0 10px 10px 0;
  background: #f7fee7;
}

.ps-hub-vacio-chico {
  margin: 0.2rem 0 0.5rem;
}

.ps-hub-editar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.ps-hub-editar .ps-hub-punto,
.ps-hub-editar > .btn,
.ps-hub-editar > .ps-hub-ancho {
  grid-column: 1 / -1;
  justify-self: start;
}

.ps-hub .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ps-hub-item[hidden] {
  display: none !important;
}

.ps-hub a:focus-visible,
.ps-hub button:focus-visible,
.ps-hub input:focus-visible,
.ps-hub select:focus-visible,
.ps-hub summary:focus-visible {
  outline: 2px solid var(--ps-accent);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .ps-hub-editar {
    grid-template-columns: 1fr;
  }

  .ps-hub-alta-grid > label,
  .ps-hub-alta-grid > label:nth-child(2),
  .ps-hub-lote-alta > .form-control,
  .ps-hub-lote-alta > .form-control[name="nuevoLoteSuperficie"] {
    flex: 1 1 100%;
  }
}

html.tema-noche .ps-hub-intro,
html.tema-noche .ps-hub-punto p,
html.tema-noche .ps-hub-nota,
html.tema-noche .ps-hub-notas,
html.tema-noche .ps-hub-vacio,
html.tema-noche .ps-hub-conteo {
  color: #d5ddd6;
}

html.tema-noche .ps-hub-tab,
html.tema-noche .ps-hub-alta,
html.tema-noche .ps-hub-item,
html.tema-noche .ps-hub summary {
  background: #343d37;
  border-color: #4a564e;
  color: #e6ebe7;
}

html.tema-noche .ps-hub-tab span,
html.tema-noche .ps-hub-badge {
  background: #3a463d;
  color: #e6ebe7;
}

html.tema-noche .ps-hub-tab.is-active,
html.tema-noche .ps-hub-tab.is-active:hover {
  background: #4d5c52;
  border-color: #6f8f78;
  color: #f4f7f4;
}

html.tema-noche .ps-hub-hijo,
html.tema-noche .ps-hub details[open] > summary {
  background: #3a463d;
  border-color: #6f8f78;
}

html.tema-noche .ps-hub-badge.is-ok {
  background: #3f6212;
  color: #ecfccb;
}

.ps-mapa-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) 1fr;
  gap: 0.8rem;
  align-items: stretch;
}

.ps-mapa-lista {
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);
  max-height: 72vh;
  overflow: auto;
  padding: 0.7rem;
}

.ps-mapa-lista h2 {
  margin: 0.8rem 0 0.35rem;
  font-size: 0.95rem;
}

.ps-mapa-lista h2:first-child {
  margin-top: 0;
}

.ps-mapa-item,
.ps-mapa-sub button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  color: inherit;
  cursor: pointer;
}

.ps-mapa-item {
  font-weight: 700;
}

.ps-mapa-item small,
.ps-mapa-sub small {
  display: block;
  font-weight: 500;
  color: #3f6212;
}

.ps-mapa-sub {
  margin: 0 0 0.4rem 0.6rem;
  padding: 0;
  list-style: none;
}

.ps-mapa-item:hover,
.ps-mapa-sub button:hover,
.ps-mapa-item.is-active,
.ps-mapa-sub button.is-active {
  background: #ecfccb;
}

.ps-mapa-lienzo {
  height: 72vh;
  min-height: 420px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);
  z-index: 1;
}

.ps-mapa-ficha strong {
  display: block;
  margin-bottom: 0.15rem;
}

.ps-mapa-ficha span {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #ecfccb;
  font-size: 0.8rem;
  font-weight: 700;
}

.leaflet-popup-content .ps-mapa-ficha p {
  margin: 0.2rem 0;
}

@media (max-width: 800px) {
  .ps-mapa-layout {
    grid-template-columns: 1fr;
  }

  .ps-mapa-lista,
  .ps-mapa-lienzo {
    max-height: none;
    height: 58vh;
    min-height: 280px;
  }
}

html.tema-noche .ps-mapa-lista {
  background: #343d37;
  border-color: #4a564e;
  color: #e6ebe7;
}

html.tema-noche .ps-mapa-item small,
html.tema-noche .ps-mapa-sub small {
  color: #d9f99d;
}

html.tema-noche .ps-mapa-item:hover,
html.tema-noche .ps-mapa-sub button:hover,
html.tema-noche .ps-mapa-item.is-active,
html.tema-noche .ps-mapa-sub button.is-active {
  background: #3f6212;
  color: #f7fee7;
}

.ps-perfiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.8rem;
}

.ps-perfil {
  margin: 0;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 0.85rem;
  background: #fff;
}

.ps-perfil.is-activo {
  border-color: var(--ps-accent);
  box-shadow: 0 0 0 2px rgba(101, 163, 13, 0.28);
}

.ps-perfil-muestras {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.ps-perfil-muestras span {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.ps-perfil-uso {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #ecfccb;
  color: #1a2e05;
  font-size: 0.78rem;
  font-weight: 700;
}

.ps-perfil-acciones {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.ps-perfil-nuevo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: flex-end;
  margin-top: 1rem;
}

.ps-perfil-nuevo label {
  flex: 1 1 16rem;
  margin: 0;
  font-weight: 600;
}

html.tema-noche .ps-perfil {
  background: #343d37;
  border-color: #4a564e;
  color: #e6ebe7;
}

html.tema-noche .ps-perfil-uso {
  background: #3f6212;
  color: #ecfccb;
}

.ps-captcha {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.ps-captcha img {
  border-radius: 8px;
  background: #fff;
}

.ps-captcha input {
  flex: 1 1 8rem;
  min-width: 8rem;
}

.ps-foto-mini {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 0.4rem;
  vertical-align: middle;
  border: 1px solid var(--ps-border);
}

.ps-foto-previa {
  display: block;
  max-width: 160px;
  max-height: 96px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0.4rem 0;
  border: 1px solid var(--ps-border);
}

.ps-foto-previa[hidden] {
  display: none;
}

.ps-wa {
  color: #128c7e;
  font-weight: 600;
  white-space: nowrap;
}

.ps-wa:hover {
  color: #075e54;
}

.ps-mapa-foto {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.4rem;
}

/* Formularios de carga: remito y entrega */
.ps-carga {
  display: grid;
  grid-template-columns: minmax(22rem, 34rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.ps-carga-form,
.ps-carga-catalogo,
.ps-carga-panel {
  min-width: 0;
}

.ps-carga-panel,
.ps-carga-catalogo {
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);
  padding: 1rem 1.05rem 1.1rem;
  margin-bottom: 0.8rem;
}

.ps-carga-panel h2,
.ps-carga-catalogo h2,
.ps-carga-destino legend {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.ps-carga-nota,
.ps-carga-ayuda,
.ps-carga-vacio,
.ps-carga-conteo {
  margin: 0.2rem 0 0.7rem;
  color: #3f6212;
  font-weight: 500;
}

.ps-carga-ayuda,
.ps-carga-conteo {
  display: block;
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
}

.ps-carga-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ps-carga-ancho,
.ps-carga-destino {
  grid-column: 1 / -1;
}

.ps-carga label,
.ps-carga-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.ps-carga label .form-control + .form-control,
.ps-carga label input + select,
.ps-carga-grid label input + select {
  margin-top: 0.15rem;
}

.ps-carga-destino {
  margin: 0.9rem 0 0;
  padding: 0.85rem 0.9rem 1rem;
  border: 1px solid var(--ps-border);
  border-left: 3px solid var(--ps-accent);
  border-radius: 10px;
  background: #f7fee7;
}

.ps-carga-destino legend {
  width: auto;
  padding: 0 0.35rem;
  font-size: 1rem;
}

.ps-carga-lineas > .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem;
  gap: 0.45rem;
  align-items: center;
  margin: 0 0 0.5rem;
  padding: 0.55rem 0.65rem;
  background: #f7fee7;
  border-radius: 10px;
  border-left: 3px solid var(--ps-accent);
}

.ps-carga-lineas > .row > div {
  width: auto;
  max-width: none;
  padding: 0;
}

.ps-carga-lineas > .row > div:nth-child(3) {
  grid-column: 1 / -1;
}

.ps-carga-lineas .input-group {
  flex-wrap: nowrap;
}

.ps-carga-vacio[hidden] {
  display: none;
}

.ps-carga-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.ps-carga-footer .ps-carga-nota {
  margin: 0;
  flex: 1 1 14rem;
}

.ps-carga-footer .btn {
  min-height: 2.6rem;
  min-width: 11rem;
  font-weight: 700;
}

.ps-carga input:focus,
.ps-carga select:focus,
.ps-carga textarea:focus,
.ps-carga-grid input:focus,
.ps-carga-grid select:focus,
.ps-carga-grid textarea:focus {
  border-color: var(--ps-accent);
  box-shadow: 0 0 0 0.15rem rgba(101, 163, 13, 0.25);
}

@media (max-width: 992px) {
  .ps-carga {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ps-carga-grid,
  .ps-carga-lineas > .row {
    grid-template-columns: 1fr;
  }

  .ps-carga-footer .btn {
    width: 100%;
  }
}

html.tema-noche .ps-carga-panel,
html.tema-noche .ps-carga-catalogo,
html.tema-noche .ps-carga-destino,
html.tema-noche .ps-carga-lineas > .row {
  background: #343d37;
  border-color: #4a564e;
  color: #e6ebe7;
}

html.tema-noche .ps-carga-nota,
html.tema-noche .ps-carga-ayuda,
html.tema-noche .ps-carga-vacio,
html.tema-noche .ps-carga-conteo {
  color: #d5ddd6;
}

/* Productos: alta y ficha en la fila */
.ps-segun-tipo {
  display: none;
}

.ps-prod-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.ps-prod-header p,
.ps-prod-panel-head p,
.ps-prod-ayuda,
.ps-prod-leyenda {
  margin: 0.2rem 0 0;
  color: #3f6212;
  font-size: 0.92rem;
  font-weight: 500;
}

.ps-prod-herramientas,
.ps-prod-panel-acciones,
.ps-prod-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.content-wrapper > .ps-prod-panel,
.ps-prod-card {
  margin: 0 0.35rem 1rem;
}

.ps-prod-panel {
  padding: 1rem 1.1rem 1.05rem;
  background: #f7fee7;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
}

.ps-prod-panel h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a2e05;
}

.ps-prod-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.ps-prod-panel fieldset {
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.85rem 0.9rem;
  background: #fff;
}

.ps-prod-panel legend {
  width: auto;
  padding: 0 0.35rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2e05;
}

.ps-prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem 1rem;
}

.ps-prod-grid > label,
.ps-prod-campo {
  display: block;
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.ps-prod-grid > label.ps-segun-tipo {
  display: none;
}

.ps-prod-ancho {
  grid-column: 1 / -1;
}

.ps-prod-grid .form-control,
.ps-prod-campo .form-control {
  margin-top: 0.35rem;
}

.ps-prod-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  margin: 0.45rem 0;
  font-weight: 600;
}

.ps-prod-deposito {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--ps-border);
  font-weight: 700;
}

.ps-prod-tabs {
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  border: 0;
  padding-bottom: 0.35rem;
}

.ps-prod-tabs .nav-link {
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  color: #3f6212;
  font-weight: 700;
}

.ps-prod-tabs .nav-link.active,
.ps-prod-tabs .nav-link:hover {
  background: #ecfccb;
  color: #1a2e05;
}

.ps-prod-tabs .nav-link.active {
  background: var(--ps-primary);
  color: #fff;
}

.ps-prod-scroll {
  overflow-x: auto;
}

.ps-prod-abrir {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3f6212;
  cursor: pointer;
}

.ps-prod-abrir:hover,
tr.ps-prod-abierta .ps-prod-abrir {
  background: #ecfccb;
}

.ps-prod-tabla tbody tr:not(.ps-prod-child) {
  cursor: pointer;
}

.ps-prod-tabla td.ps-prod-nombre {
  text-align: left !important;
}

.ps-prod-celda {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  font-weight: 600;
}

.ps-foto-mini {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
}

.ps-foto-previa,
.ps-prod-foto img {
  display: block;
  width: 100%;
  max-width: 160px;
  max-height: 140px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.45rem;
}

.ps-stock {
  display: inline-flex;
  min-width: 2.5rem;
  justify-content: center;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
}

.ps-stock-ok {
  background: #d9f99d;
  color: #1a2e05;
}

.ps-stock-bajo {
  background: #fecaca;
  color: #7f1d1d;
}

.ps-prod-tabla tr.ps-prod-aviso > td:first-child {
  box-shadow: inset 3px 0 0 #dc2626;
}

.ps-prod-tabla tr.ps-prod-abierta > td {
  background: #ecfccb !important;
}

.ps-prod-tabla tr.ps-prod-child > td,
.ps-prod-tabla td.ps-prod-child {
  padding: 0 !important;
  background: #f7fee7 !important;
  text-align: left !important;
  cursor: default;
}

.ps-prod-scroll .dataTables_wrapper,
.ps-prod-tabla {
  width: 100% !important;
}

.ps-prod-tabla th,
.ps-prod-tabla td {
  vertical-align: middle;
}

.ps-prod-tabla th:nth-child(1),
.ps-prod-tabla td:nth-child(1),
.ps-prod-tabla th:nth-child(3),
.ps-prod-tabla td:nth-child(3),
.ps-prod-tabla th:nth-child(4),
.ps-prod-tabla td:nth-child(4),
.ps-prod-tabla th:nth-child(5),
.ps-prod-tabla td:nth-child(5),
.ps-prod-tabla th:nth-child(6),
.ps-prod-tabla td:nth-child(6),
.ps-prod-tabla th.ps-prod-col-acc,
.ps-prod-tabla td.ps-prod-col-acc {
  width: 1%;
  white-space: nowrap;
}

.ps-prod-tabla th:nth-child(2),
.ps-prod-tabla td.ps-prod-nombre {
  width: 99%;
}

.ps-prod-tabla .ps-prod-acciones {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  justify-content: center;
}

.ps-prod-tabla .ps-prod-acciones .btn {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ps-prod-tabla td.ps-prod-col-acc,
.ps-prod-tabla th.ps-prod-col-acc {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.ps-prod-chip {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--ps-border);
  font-size: 0.78rem;
  font-weight: 700;
}

.ps-prod-aviso-texto {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: #fef3c7;
  color: #78350f;
  font-weight: 600;
}

.ps-prod-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.ps-prod-sin-foto {
  grid-template-columns: 1fr;
}

.ps-prod-datos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.55rem;
  margin: 0;
}

.ps-prod-datos div {
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}

.ps-prod-datos dt {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3f6212;
  font-weight: 700;
}

.ps-prod-datos dd {
  margin: 0.12rem 0 0;
  font-weight: 600;
  color: #1a2e05;
}

.ps-dato-alerta {
  color: #b91c1c;
}

.ps-dato-pronto {
  color: #a16207;
}

.ps-prod-leyenda {
  margin-top: 0.8rem;
}

.ps-prod-leyenda .ps-stock {
  margin: 0 0.15rem;
}

@media (max-width: 720px) {
  .ps-prod-layout,
  .ps-prod-panel-head,
  .ps-prod-header {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .ps-prod-herramientas .btn,
  .ps-prod-panel-acciones .btn {
    width: 100%;
  }
}

html.tema-noche .ps-prod-panel,
html.tema-noche .ps-prod-panel fieldset,
html.tema-noche .ps-prod-datos div,
html.tema-noche .ps-prod-deposito,
html.tema-noche .ps-prod-chip {
  background: #2a332e;
  border-color: #4a564e;
  color: #e6ebe7;
}

html.tema-noche .ps-prod-panel h2,
html.tema-noche .ps-prod-panel legend,
html.tema-noche .ps-prod-datos dd {
  color: #f4f7f4;
}

html.tema-noche .ps-prod-header p,
html.tema-noche .ps-prod-panel-head p,
html.tema-noche .ps-prod-ayuda,
html.tema-noche .ps-prod-leyenda,
html.tema-noche .ps-prod-datos dt {
  color: #d5ddd6;
}

html.tema-noche .ps-prod-tabla tr.ps-prod-child > td,
html.tema-noche .ps-prod-tabla td.ps-prod-child,
html.tema-noche .ps-prod-tabla tr.ps-prod-abierta > td {
  background: #232a26 !important;
  color: #f4f7f4 !important;
}

/* Historial de movimientos */
.ps-hist-ficha {
  margin: 0 0 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 12px;
  border: 1px solid var(--ps-border);
  background: #f7fee7;
  color: #1a2e05;
}

.ps-hist-ficha h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a2e05;
}

.ps-hist-ficha p {
  margin: 0.15rem 0 0;
  color: #365314;
}

.ps-hist-resumen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.ps-hist-dato {
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
}

.ps-hist-dato span {
  display: block;
  color: #3f6212;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ps-hist-dato strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.45rem;
  color: #1a2e05;
}

.ps-hist-salida td:first-child {
  box-shadow: inset 3px 0 0 #dc2626;
}

.ps-hist-entrada td:first-child {
  box-shadow: inset 3px 0 0 #15803d;
}

.ps-hist-vacio {
  margin: 0;
}

.ps-dia-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.ps-dia-nav input[type="date"] {
  width: 11rem;
}

.ps-dia-titulo {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.ps-dia-nota {
  margin: 0 0 0.8rem;
  color: var(--ps-muted, #4b5563);
}

.ps-dia-tabla td {
  white-space: normal;
  vertical-align: top;
}

html.tema-noche .ps-dia-titulo {
  color: #f4f7f4;
}

html.tema-noche .ps-dia-nota {
  color: #d5ddd6;
}

@media print {
  .ps-dia-no-print,
  .main-sidebar,
  .main-header,
  .main-footer {
    display: none !important;
  }

  .ps-dia .content-wrapper,
  .ps-dia.content-wrapper {
    margin: 0 !important;
    background: #fff !important;
    color: #111 !important;
  }
}

/* Noche: contraste de tablas, filtros y botones */
html.tema-noche .ps-hist-ficha,
html.tema-noche .ps-hist-dato,
html.tema-noche .alert,
html.tema-noche .alert-success,
html.tema-noche .bg-light,
html.tema-noche .bg-white {
  background: #2a332e !important;
  border-color: #6b7a70 !important;
  color: #f4f7f4 !important;
}

html.tema-noche .ps-hist-ficha h2,
html.tema-noche .ps-hist-dato strong,
html.tema-noche .alert h1,
html.tema-noche .alert h2,
html.tema-noche .alert h3,
html.tema-noche .alert h4,
html.tema-noche .alert h5 {
  color: #f4f7f4 !important;
}

html.tema-noche .ps-hist-ficha p,
html.tema-noche .ps-hist-dato span,
html.tema-noche .alert p {
  color: #d5ddd6 !important;
}

html.tema-noche .ps-prod-tabs .nav-link {
  background: #2a332e;
  border: 1px solid #6b7a70;
  color: #f4f7f4;
}

html.tema-noche .ps-prod-tabs .nav-link:hover {
  background: #465248;
  color: #f4f7f4;
}

html.tema-noche .ps-prod-tabs .nav-link.active,
html.tema-noche .ps-prod-tabs .nav-link.active:hover {
  background: #3f6212;
  border-color: #8fbc8f;
  color: #f7fee7;
}

html.tema-noche .btn-primary,
html.tema-noche .btn-primary:hover,
html.tema-noche .btn-primary:focus,
html.tema-noche .btn-info,
html.tema-noche .btn-info:hover,
html.tema-noche .btn-info:focus {
  background: #3f6212 !important;
  border-color: #8fbc8f !important;
  color: #f7fee7 !important;
}

html.tema-noche .btn-default,
html.tema-noche .btn-secondary,
html.tema-noche .btn-default:hover,
html.tema-noche .btn-secondary:hover {
  background: #3a443d !important;
  border-color: #8aa584 !important;
  color: #f4f7f4 !important;
}

html.tema-noche .dataTables_wrapper .dataTables_filter,
html.tema-noche .dataTables_wrapper .dataTables_length,
html.tema-noche .dataTables_wrapper .dataTables_info,
html.tema-noche .dataTables_wrapper .dataTables_filter label,
html.tema-noche .dataTables_wrapper .dataTables_length label {
  color: #f4f7f4 !important;
}

html.tema-noche .dataTables_wrapper .dataTables_filter input,
html.tema-noche .dataTables_wrapper .dataTables_length select,
html.tema-noche .custom-select,
html.tema-noche .form-control,
html.tema-noche .page-link {
  background: #232a26 !important;
  color: #f4f7f4 !important;
  border-color: #8aa584 !important;
}

html.tema-noche .page-item.active .page-link,
html.tema-noche .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html.tema-noche .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #3f6212 !important;
  border-color: #8fbc8f !important;
  color: #f7fee7 !important;
}

html.tema-noche .table-hover tbody tr:hover,
html.tema-noche .table-hover tbody tr:hover > td,
html.tema-noche .table-hover tbody tr:hover > th,
html.tema-noche .ps-lista tbody tr:hover,
html.tema-noche .ps-lista tbody tr:hover td,
html.tema-noche table.dataTable.hover tbody tr:hover,
html.tema-noche table.dataTable.hover tbody tr:hover > *,
html.tema-noche table.dataTable.display tbody tr:hover,
html.tema-noche table.dataTable.display tbody tr:hover > *,
html.tema-noche table.dataTable.table-hover > tbody > tr:hover > * {
  background: #465248 !important;
  background-color: #465248 !important;
  color: #f4f7f4 !important;
  box-shadow: none !important;
}

