:root {
  --green-dark: #031f18;
  --green: #08382c;
  --green-soft: #e9f5e9;
  --gold: #c68a19;
  --gold-light: #f7c95b;
  --text: #111915;
  --muted: #6f6f6f;
  --line: #ece8e2;
  --bg: #fdfbf8;
  --danger: #e32116;
  --success: #108423;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  display: flex;
  font-family: "Inter", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.2px;
  color: var(--text);
  background: var(--bg);
}

button, input, select {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.sidebar {
  width: 250px;
  min-height: 100vh;
  padding: 22px 18px;
  color: var(--white);
  background: radial-gradient(circle at top left, #0a4739 0%, #031b15 42%, #02120f 100%);
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
}

.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.logo-image {
  width: 170px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(247, 201, 91, .35));
}

.menu {
  display: grid;
  gap: 10px;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  color: var(--white);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
}

.menu a span {
  width: 26px;
  flex: 0 0 26px;
  color: #ffbd37;
  font-size: 22px;
}

.menu-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 18px;
  display: block;
}

.menu a.active .menu-icon {
  filter: drop-shadow(0 0 6px rgba(247, 201, 91, .45));
}

.menu a.active {
  color: var(--gold-light);
  border: 1px solid var(--gold);
  background: rgba(255, 203, 94, .12);
}

.sidebar-card {
  margin-top: 36px;
  padding: 22px 24px;
  border: 1px solid var(--gold);
  border-radius: 14px;
  line-height: 1.55;
  background: rgba(255, 255, 255, .02);
}

.sidebar-card .shield,
.sidebar-card span {
  color: var(--gold-light);
  font-size: 32px;
}

.sidebar-card strong { color: var(--gold-light); }

.content {
  width: calc(100% - 250px);
  margin-left: 250px;
  padding: 34px 38px 36px;
}

.topbar, .title-area, .user-actions, .action-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.title-area { gap: 24px; }
.hamburger {
  border: 0;
  background: transparent;
  font-size: 32px;
  cursor: pointer;
}

h1 {
  font-size: 38px;
  line-height: 1.1;
  color: #072019;
  margin-bottom: 8px;
}

.title-area p { color: #121212; }

.user-actions { gap: 12px; }
.bell {
  position: relative;
  font-size: 28px;
}
.bell span {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  background: #1c9a31;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}
.avatar {
  width: 43px;
  height: 43px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green-dark);
}

.action-row {
  justify-content: flex-end;
  margin-top: -72px;
  margin-bottom: 20px;
}

.new-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green-dark);
  background: var(--white);
  box-shadow: none;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.new-product span { color: var(--green-dark); font-size: 20px; line-height: 1; vertical-align: middle; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  min-height: 146px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  display: flex;
  align-items: center;
  gap: 28px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, .03);
}

.icon {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 800;
}
.icon.amber { color: var(--gold); background: #edf6e9; }
.icon.green { color: #00711b; background: #e9f7e8; }
.icon.red { color: var(--danger); background: #fdeceb; }

.stat-card h3 { font-size: 14px; margin-bottom: 12px; }
.stat-card strong { display: block; font-size: 31px; margin-bottom: 10px; }
.stat-card p { color: var(--muted); }
.green-text { color: var(--success); font-weight: 800; }
.red-text { color: var(--danger); font-weight: 800; }

.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  margin-bottom: 20px;
}

.search-box, .filters select, .filters button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}
.search-box span { color: #927f6c; font-size: 24px; }
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
}
.filters select { padding: 0 18px; }
.filters button { padding: 0 22px; font-weight: 800; cursor: pointer; }

.table-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 16px 28px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 14px;
  font-weight: 800;
  color: #102018;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 0;
}


.product-name {
  color: #9a6111;
  font-weight: 800;
  margin-bottom: 6px;
}
.stock { color: var(--success); font-weight: 800; }
.stock.zero { color: var(--danger); }
.total-value {
  color: #102018;
  font-weight: 800;
}
.total-field input[readonly] {
  background: #fff8e8;
  color: var(--green-dark);
  font-weight: 800;
}
.total-field small {
  color: var(--muted);
  font-weight: 600;
}
.price-mode {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
}
.badge.ok { color: var(--success); background: #e8f5e7; }
.badge.no { color: var(--danger); background: #fde5e0; }
.action-dots { color: #b97805; font-size: 24px; font-weight: 800; }

.table-footer {
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #545454;
}
.pagination { display: flex; gap: 12px; }
.pagination button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #faf9f7;
  cursor: pointer;
}
.pagination .current { color: white; background: var(--green-dark); }

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .sidebar { position: static; width: 100%; min-height: auto; }
  body { flex-direction: column; }
  .content { width: 100%; margin-left: 0; }
  .filters { grid-template-columns: 1fr; }
}


.logo img{
  width:120px;
  height:auto;
}

/* Página: Nuevo Producto */

.product-topbar {
  width: 100%;
  max-width: none;
  margin-bottom: 24px;
  gap: 0;
}

.product-topbar .title-area {
  min-width: 0;
  flex: 1 1 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green-dark);
  background: var(--white);
  font-weight: 800;
  text-decoration: none;
  flex: 0 0 auto;
  white-space: nowrap;
}

.form-shell {
  width: 100%;
  max-width: none;
}

.product-form {
  display: grid;
  gap: 24px;
}

.form-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .03);
}

.form-card-header {
  margin-bottom: 22px;
}

.form-card-header h2 {
  font-size: 20px;
  color: #072019;
  margin-bottom: 6px;
}

.form-card-header p {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 18px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: #14231d;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  outline: none;
}

.field input,
.field select {
  min-height: 50px;
  padding: 0 16px;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
  padding: 14px 16px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(198, 138, 25, .14);
}

.full-width {
  grid-column: 1 / -1;
}

.upload-box {
  min-height: 180px;
  border: 1px dashed var(--gold);
  border-radius: 12px;
  background: #fffdf8;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
}

.upload-box input {
  display: none;
}

.upload-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: #fff4d4;
  font-size: 30px;
  font-weight: 800;
}

.upload-box strong {
  color: var(--green-dark);
  font-size: 16px;
}

.upload-box small {
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
  padding-bottom: 24px;
}

.btn-primary,
.btn-secondary,
.btn-light {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 9px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  border: 0;
  color: var(--white);
  background: linear-gradient(180deg, #0b3d31, #031f18);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .18);
}

.btn-secondary,
.btn-light {
  border: 1px solid var(--line);
  color: var(--green-dark);
  background: var(--white);
}

@media (max-width: 760px) {
  .two-columns {
    grid-template-columns: 1fr;
  }

  .product-topbar,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-card {
    padding: 22px;
  }
}

/* Página: Proveedores */

.provider-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.provider-form .form-actions {
  padding-bottom: 0;
}

.provider-summary {
  display: grid;
  gap: 18px;
}

.provider-stat-card {
  min-height: 132px;
  padding: 24px;
}

.provider-filters {
  grid-template-columns: 1.4fr 1fr 1fr;
}

.provider-document {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.table-action {
  border: 0;
  background: transparent;
  color: #b97805;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.empty-table {
  padding: 28px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

@media (max-width: 1180px) {
  .provider-layout {
    grid-template-columns: 1fr;
  }

  .provider-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .provider-summary,
  .provider-filters {
    grid-template-columns: 1fr;
  }
}


/* Página: Facturación */

.billing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.billing-form .form-actions {
  padding-bottom: 0;
}

.invoice-summary-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .04);
  position: sticky;
  top: 24px;
}

.invoice-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.invoice-summary-row strong {
  color: var(--green-dark);
  font-size: 18px;
}

.invoice-summary-row.total {
  border-bottom: 0;
  color: var(--text);
}

.invoice-summary-row.total strong {
  color: var(--gold);
  font-size: 26px;
}

.invoice-note {
  margin-top: 18px;
  color: var(--muted);
  font-weight: 600;
}

.invoice-items-head,
.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.invoice-items-head h3,
.table-card-header h2 {
  color: var(--green-dark);
  font-size: 20px;
}

.table-card-header p {
  color: var(--muted);
  font-weight: 700;
}

.invoice-items {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.invoice-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px 150px 42px;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf2;
}

.invoice-item-row .remove-item {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--danger);
}

@media (max-width: 1180px) {
  .billing-layout {
    grid-template-columns: 1fr;
  }

  .invoice-summary-card {
    position: static;
  }
}

@media (max-width: 860px) {
  .invoice-item-row {
    grid-template-columns: 1fr;
  }

  .invoice-items-head,
  .table-card-header {
    align-items: stretch;
    flex-direction: column;
  }
}


/* Ajuste visual: Facturación */

.billing-topbar {
  margin-bottom: 32px;
  align-items: flex-start;
  gap: 24px;
}

.billing-topbar .title-area {
  align-items: flex-start;
}

.billing-topbar h1 {
  margin-bottom: 10px;
}

.billing-topbar .new-product {
  margin-top: 4px;
}

.billing-form {
  display: grid;
  gap: 22px;
}

.billing-form .two-columns {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-section-title {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}

.form-section-title h2 {
  color: var(--green-dark);
  font-size: 22px;
  line-height: 1.2;
}

.form-section-title p {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

.billing-form > .field {
  margin-top: 2px;
}

.billing-form .form-actions {
  margin-top: 4px;
  padding-top: 10px;
}

.invoice-summary-card .form-section-title {
  margin-bottom: 18px;
}

.invoice-items-head {
  padding-top: 6px;
  margin-top: 2px;
  margin-bottom: 18px;
}

.invoice-items-head h3 {
  line-height: 1.25;
}

.table-card {
  margin-top: 30px;
}

.table-card-header {
  margin-bottom: 20px;
}

.table-card-header h2 {
  margin-bottom: 6px;
  line-height: 1.25;
}

@media (max-width: 760px) {
  .billing-form .two-columns {
    grid-template-columns: 1fr;
  }

  .billing-topbar .new-product {
    width: 100%;
  }
}

/* Ajuste visual: Historial de facturación */

.billing-history-card {
  padding: 26px;
  overflow: visible;
}

.billing-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.billing-history-header > div {
  display: grid;
  gap: 8px;
}

.billing-history-header h2 {
  margin: 0;
  line-height: 1.2;
}

.billing-history-header p {
  margin: 0;
  line-height: 1.45;
}

.billing-history-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.billing-history-table table {
  min-width: 760px;
}

.billing-history-table th,
.billing-history-table td {
  padding: 18px 22px;
}

.billing-history-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 760px) {
  .billing-history-card {
    padding: 18px;
  }

  .billing-history-header {
    flex-direction: column;
    gap: 10px;
    padding-bottom: 16px;
  }
}

/* Acciones de factura: ver, imprimir, descargar y eliminar */

.billing-history-table table {
  min-width: 980px;
}

.invoice-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 260px;
}

.table-action.danger,
.btn-danger {
  color: var(--danger);
  border-color: rgba(186, 54, 54, 0.25);
  background: #fff5f5;
}

.btn-danger {
  border: 1px solid rgba(186, 54, 54, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
}

.invoice-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.invoice-modal.is-open {
  display: flex;
}

.invoice-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 34, 25, 0.55);
}

.invoice-modal-card {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--white);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.25);
  padding: 28px;
}

.invoice-modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--green-dark);
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  z-index: 2;
}

.invoice-printable {
  display: grid;
  gap: 24px;
}

.invoice-document-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.invoice-company-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.invoice-company-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 16px;
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 8px;
}

.invoice-brand {
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.invoice-document-head h2 {
  color: var(--green-dark);
  font-size: 28px;
  margin-bottom: 8px;
}

.invoice-document-head p:not(.invoice-brand) {
  color: var(--muted);
  font-weight: 700;
}

.invoice-status-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff4d6;
  color: #735900;
  font-weight: 900;
}

.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.invoice-detail-grid > div,
.invoice-notes {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fffdf8;
}

.invoice-detail-grid span,
.invoice-notes span,
.invoice-detail-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.invoice-detail-grid strong {
  color: var(--green-dark);
}

.invoice-detail-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.invoice-detail-table table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.invoice-detail-table th,
.invoice-detail-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.invoice-detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.invoice-detail-total {
  width: min(360px, 100%);
  margin-left: auto;
  display: grid;
  gap: 10px;
}

.invoice-detail-total > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.invoice-detail-total .grand-total {
  padding-top: 14px;
  border-top: 2px solid var(--green-dark);
  color: var(--green-dark);
  font-size: 22px;
}

.invoice-notes p {
  color: var(--text);
  font-weight: 600;
  line-height: 1.5;
}

.invoice-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .invoice-modal {
    padding: 12px;
  }

  .invoice-modal-card {
    padding: 18px;
  }

  .invoice-document-head,
  .invoice-modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .invoice-detail-grid {
    grid-template-columns: 1fr;
  }

  .invoice-row-actions {
    min-width: 0;
  }
}


/* Página: Clientes */
.client-layout {
  margin-bottom: 24px;
}

.client-form .form-actions {
  padding-bottom: 0;
}

.client-filters {
  margin-top: 4px;
}

/* Mejora visual de botones de acción en facturación */
.invoice-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 10px;
  min-width: 270px;
}

.invoice-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}

.invoice-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(40, 80, 70, 0.12);
}

.invoice-action:focus-visible {
  outline: 3px solid rgba(218, 161, 35, 0.32);
  outline-offset: 2px;
}

.invoice-action .action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 7px;
  font-size: 13px;
}

.invoice-action-view {
  border-color: rgba(34, 111, 84, 0.22);
  background: #f3fbf7;
  color: #14573c;
}

.invoice-action-print {
  border-color: rgba(35, 82, 124, 0.22);
  background: #f4f8fc;
  color: #1c527a;
}

.invoice-action-download {
  border-color: rgba(183, 126, 15, 0.25);
  background: #fffaf0;
  color: #9b6400;
}

.invoice-action-delete {
  border-color: rgba(186, 54, 54, 0.24);
  background: #fff5f5;
  color: var(--danger);
}

.invoice-action-delete:hover {
  border-color: rgba(186, 54, 54, 0.45);
  background: #ffecec;
}

.invoice-modal-actions .invoice-action {
  min-width: 145px;
}

@media (max-width: 760px) {
  .invoice-row-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .invoice-action {
    width: 100%;
  }
}

/* Página: Inventarios actualizada */
.inventory-topbar {
  margin-bottom: 18px;
}

.inventory-actions-main {
  gap: 12px;
}

.secondary-action {
  background: #fff8e8;
  border-color: rgba(198, 138, 25, 0.35);
}

.inventory-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-stat-card {
  padding: 14px 16px;
  gap: 10px;
  min-height: 92px;
}

.inventory-stat-card .icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  font-size: 20px;
}

.inventory-stat-card .icon img {
  width: 32px !important;
  height: 32px !important;
}

.inventory-stat-card h3 {
  font-size: 11px;
  margin-bottom: 5px;
  letter-spacing: 0.04em;
}

.inventory-stat-card strong {
  font-size: 24px;
  margin-bottom: 4px;
  line-height: 1.05;
}

.inventory-stat-card p {
  font-size: 12px;
  line-height: 1.25;
}

.gold-icon {
  color: #9b6400;
  background: #fff5d6;
}

.inventory-filters {
  grid-template-columns: 1.6fr 1fr 1fr auto;
}

.inventory-table-card {
  overflow: visible;
}

.inventory-table-header {
  border-bottom: 1px solid var(--line);
}


.inventory-list-header {
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
}

.inventory-list-title {
  display: grid;
  gap: 6px;
}

.inventory-list-title h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 24px;
  line-height: 1.1;
}

.inventory-list-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.section-eyebrow {
  color: #b77e0f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.inventory-date-card {
  display: grid;
  gap: 3px;
  min-width: 170px;
  padding: 10px 14px;
  border: 1px solid rgba(183, 126, 15, 0.25);
  border-radius: 14px;
  background: #fff8e8;
  color: #9b6400;
  text-align: right;
}

.inventory-date-card span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inventory-date-card strong {
  color: var(--green-dark);
  font-size: 15px;
  line-height: 1.1;
}

.inventory-date-card small {
  color: #9b6400;
  font-size: 12px;
  font-weight: 800;
}

.inventory-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff8e8;
  color: #9b6400;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
}

.responsive-table table {
  min-width: 1050px;
}

.inventory-product-cell {
  gap: 12px;
}

.inventory-product-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff8e8;
  font-size: 19px;
}

.inventory-source-label {
  color: var(--muted);
  font-weight: 800;
}

.badge.low {
  color: #9b6400;
  background: #fff4d8;
}

.inventory-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inventory-action-btn {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--green-dark);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.inventory-action-btn.view {
  background: #f3fbf7;
  border-color: rgba(34, 111, 84, 0.22);
  color: #14573c;
}

.inventory-action-btn.edit {
  background: #fffaf0;
  border-color: rgba(183, 126, 15, 0.25);
  color: #9b6400;
}

.inventory-action-btn.delete {
  background: #fff5f5;
  border-color: rgba(185, 28, 28, 0.24);
  color: #b91c1c;
}

.inventory-action-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inventory-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 31, 24, 0.55);
}

.inventory-modal.is-open {
  display: flex;
}

.inventory-modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff8e8;
  color: var(--green-dark);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.modal-subtitle {
  margin: 8px 0 20px;
  color: var(--muted);
  font-weight: 800;
}

.inventory-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.inventory-detail-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
}

.inventory-detail-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inventory-detail-grid strong {
  color: var(--green-dark);
}

.inventory-detail-description {
  grid-column: 1 / -1;
}

@media (max-width: 1200px) {
  .inventory-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .inventory-actions-main {
    margin-top: 0;
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-stats-grid,
  .inventory-filters,
  .inventory-detail-grid {
    grid-template-columns: 1fr;
  }

  .inventory-table-header {
    align-items: flex-start;
  }

  .inventory-modal {
    padding: 12px;
  }

  .inventory-modal-card {
    padding: 22px;
  }
}

/* Ajustes listado de inventario */
.table-footer-clean {
  justify-content: flex-end;
}
.sku-normal {
  font-weight: 400;
}


@media (max-width: 700px) {
  .inventory-list-header {
    padding: 18px;
    flex-direction: column;
  }

  .inventory-date-card {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .inventory-list-title h2 {
    font-size: 21px;
  }
}

/* Ajuste fino del listado de inventario */
.inventory-table-card .responsive-table {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.inventory-table-card table {
  table-layout: fixed;
  min-width: 900px;
}

.inventory-table-card th,
.inventory-table-card td {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.35;
}

.inventory-table-card th {
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.inventory-table-card th:nth-child(1),
.inventory-table-card td:nth-child(1) { width: 20%; }
.inventory-table-card th:nth-child(2),
.inventory-table-card td:nth-child(2) { width: 13%; }
.inventory-table-card th:nth-child(3),
.inventory-table-card td:nth-child(3) { width: 13%; }
.inventory-table-card th:nth-child(4),
.inventory-table-card td:nth-child(4) { width: 9%; }
.inventory-table-card th:nth-child(5),
.inventory-table-card td:nth-child(5) { width: 12%; }
.inventory-table-card th:nth-child(6),
.inventory-table-card td:nth-child(6) { width: 13%; }
.inventory-table-card th:nth-child(7),
.inventory-table-card td:nth-child(7) { width: 9%; }
.inventory-table-card th:nth-child(8),
.inventory-table-card td:nth-child(8) { width: 11%; }

.inventory-table-card .product-name {
  margin-bottom: 0;
  line-height: 1.25;
  word-break: break-word;
}

.inventory-table-card .sku-normal,
.inventory-table-card .stock,
.inventory-table-card .total-value,
.inventory-table-card .price-mode,
.inventory-table-card .badge {
  white-space: nowrap;
}

.inventory-table-card .badge {
  min-width: 74px;
  padding: 7px 9px;
  font-size: 12px;
}

.inventory-table-card .inventory-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: stretch;
}

.inventory-table-card .inventory-action-btn {
  min-height: 30px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}

@media (max-width: 1100px) {
  .inventory-table-card table {
    min-width: 820px;
  }

  .inventory-table-card th,
  .inventory-table-card td {
    padding: 11px 10px;
  }
}

@media (max-width: 780px) {
  .inventory-table-card .responsive-table {
    overflow-x: visible;
    border-top: 0;
  }

  .inventory-table-card table,
  .inventory-table-card thead,
  .inventory-table-card tbody,
  .inventory-table-card tr,
  .inventory-table-card th,
  .inventory-table-card td {
    display: block;
    width: 100% !important;
    min-width: 0;
  }

  .inventory-table-card thead {
    display: none;
  }

  .inventory-table-card tbody {
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  .inventory-table-card tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
  }

  .inventory-table-card td {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }

  .inventory-table-card td:last-child {
    border-bottom: 0;
  }

  .inventory-table-card td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .inventory-table-card td:nth-child(1)::before { content: "Producto"; }
  .inventory-table-card td:nth-child(2)::before { content: "Categoría"; }
  .inventory-table-card td:nth-child(3)::before { content: "Código / SKU"; }
  .inventory-table-card td:nth-child(4)::before { content: "Stock"; }
  .inventory-table-card td:nth-child(5)::before { content: "Precio"; }
  .inventory-table-card td:nth-child(6)::before { content: "Valor"; }
  .inventory-table-card td:nth-child(7)::before { content: "Estado"; }
  .inventory-table-card td:nth-child(8)::before { content: "Acciones"; }

  .inventory-table-card .inventory-row-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-table-card .table-footer {
    padding: 12px 14px;
  }
}


/* Acciones compactas para Proveedores y Clientes */
.row-actions.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  min-width: 150px;
}

.mini-action {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.mini-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .08);
}

.mini-action.edit {
  color: #855b08;
  border-color: rgba(198, 138, 25, 0.28);
  background: #fff8e8;
}

.mini-action.delete {
  color: var(--danger);
  border-color: rgba(186, 54, 54, 0.25);
  background: #fff5f5;
}

.mini-action.delete:hover {
  border-color: rgba(186, 54, 54, 0.45);
  background: #ffecec;
}

@media (max-width: 760px) {
  .row-actions.compact-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .mini-action {
    width: 100%;
    text-align: center;
  }
}


/* Encabezados ajustados para listados de proveedores y clientes */
.directory-list-card {
  overflow: hidden;
}

.directory-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.directory-list-title {
  display: grid;
  gap: 6px;
}

.directory-list-title h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 24px;
  line-height: 1.1;
}

.directory-list-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.directory-date-card {
  display: grid;
  gap: 3px;
  min-width: 170px;
  padding: 10px 14px;
  border: 1px solid rgba(183, 126, 15, 0.25);
  border-radius: 14px;
  background: #fff8e8;
  color: #9b6400;
  text-align: right;
}

.directory-date-card span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.directory-date-card strong {
  color: var(--green-dark);
  font-size: 15px;
  line-height: 1.1;
}

.directory-date-card small {
  color: #9b6400;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .directory-list-header {
    flex-direction: column;
    padding: 18px;
  }

  .directory-date-card {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .directory-list-title h2 {
    font-size: 21px;
  }
}

/* Caja / cierre de caja */
.cash-topbar {
  align-items: flex-start;
  gap: 18px;
}

.cash-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.cash-stat-card .gold-icon {
  color: var(--gold);
  background: #fff4d6;
}

.cash-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 24px;
}

.cash-layout-wide {
  grid-template-columns: minmax(340px, 460px) minmax(560px, 1fr);
  align-items: start;
  gap: 30px;
}

.cash-panel {
  min-height: 100%;
}

.cash-two-columns {
  grid-template-columns: 1fr 160px;
}

.cash-close-card {
  position: sticky;
  top: 22px;
}

.cash-close-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.cash-difference {
  padding: 14px 16px;
  border: 1px solid #e7ddc7;
  border-radius: 12px;
  color: var(--green-dark);
  background: #fffdf8;
  font-weight: 900;
  text-align: center;
}

.cash-difference.is-negative {
  color: var(--danger);
  background: #fdeceb;
  border-color: #f5c8c4;
}

.cash-difference.is-positive {
  color: var(--success);
  background: #e9f7e8;
  border-color: #cbe9cd;
}

.cash-table-card {
  margin-bottom: 24px;
}

.cash-table-card .responsive-table {
  overflow-x: auto;
}

.cash-payment-card {
  min-width: 0;
  overflow: visible;
}

.cash-payment-card .table-card-header {
  padding: 26px 28px 0;
  margin-bottom: 18px;
}

.cash-payment-card .table-card-header h2 {
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.cash-payment-card .table-card-header p {
  line-height: 1.45;
}

.cash-payment-card .responsive-table {
  padding: 0 28px 28px;
  overflow-x: visible;
}

.cash-payment-card .responsive-table table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.cash-payment-card th,
.cash-payment-card td {
  padding: 18px 20px;
}

.cash-payment-card th:nth-child(1),
.cash-payment-card td:nth-child(1) { width: 46%; }

.cash-payment-card th:nth-child(2),
.cash-payment-card td:nth-child(2) { width: 24%; text-align: center; }

.cash-payment-card th:nth-child(3),
.cash-payment-card td:nth-child(3) { width: 30%; text-align: right; }

.cash-payment-card .empty-table {
  padding: 36px 22px;
  white-space: normal;
}

.cash-movements-card {
  overflow: visible;
}

.cash-movements-card .table-card-header {
  padding: 26px 28px 0;
  margin-bottom: 18px;
}

.cash-movements-card .table-card-header h2 {
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.cash-movements-card .table-card-header p {
  max-width: 720px;
  line-height: 1.45;
}

.cash-movements-card .responsive-table {
  padding: 0 28px 28px;
  overflow-x: auto;
}

.cash-movements-card .responsive-table table {
  min-width: 920px;
  width: 100%;
}

.cash-movements-card th,
.cash-movements-card td {
  padding: 18px 20px;
}

.cash-movements-card th:nth-child(1),
.cash-movements-card td:nth-child(1) { width: 12%; }

.cash-movements-card th:nth-child(2),
.cash-movements-card td:nth-child(2) { width: 14%; }

.cash-movements-card th:nth-child(3),
.cash-movements-card td:nth-child(3) { width: 32%; }

.cash-movements-card th:nth-child(4),
.cash-movements-card td:nth-child(4) { width: 16%; }

.cash-movements-card th:nth-child(5),
.cash-movements-card td:nth-child(5),
.cash-movements-card th:nth-child(6),
.cash-movements-card td:nth-child(6) {
  width: 13%;
  text-align: right;
}

.cash-movements-card .empty-table {
  padding: 38px 22px;
  white-space: normal;
}

.cash-closings-card {
  overflow: visible;
}

.cash-closings-card .table-card-header {
  padding: 26px 28px 0;
  margin-bottom: 18px;
}

.cash-closings-card .table-card-header h2 {
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.cash-closings-card .table-card-header p {
  max-width: 720px;
  line-height: 1.45;
}

.cash-closings-card .responsive-table {
  padding: 0 28px 28px;
  overflow-x: auto;
}

.cash-closings-card .responsive-table table {
  min-width: 960px;
  width: 100%;
}

.cash-closings-card th,
.cash-closings-card td {
  padding: 18px 20px;
}

.cash-closings-card th:nth-child(1),
.cash-closings-card td:nth-child(1) { width: 15%; }

.cash-closings-card th:nth-child(2),
.cash-closings-card td:nth-child(2) { width: 23%; }

.cash-closings-card th:nth-child(3),
.cash-closings-card td:nth-child(3) { width: 14%; text-align: right; }

.cash-closings-card th:nth-child(4),
.cash-closings-card td:nth-child(4),
.cash-closings-card th:nth-child(5),
.cash-closings-card td:nth-child(5),
.cash-closings-card th:nth-child(6),
.cash-closings-card td:nth-child(6) {
  width: 16%;
  text-align: right;
}

.cash-closings-card .empty-table {
  padding: 38px 22px;
  white-space: normal;
}

.cash-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.cash-badge.in {
  color: var(--success);
  background: #e9f7e8;
}

.cash-badge.out {
  color: var(--danger);
  background: #fdeceb;
}

.cash-outcome {
  color: var(--danger);
  font-weight: 900;
}

@media (max-width: 1280px) {
  .cash-layout-wide {
    grid-template-columns: 1fr;
  }

  .cash-payment-card .responsive-table {
    overflow-x: auto;
  }
}

@media (max-width: 1050px) {
  .cash-stats-grid,
  .cash-layout {
    grid-template-columns: 1fr;
  }

  .cash-close-card {
    position: static;
  }
}

@media (max-width: 700px) {
  .cash-two-columns {
    grid-template-columns: 1fr;
  }

  .cash-topbar {
    flex-direction: column;
  }

  .cash-payment-card .table-card-header,
  .cash-movements-card .table-card-header,
  .cash-closings-card .table-card-header {
    padding: 22px 20px 0;
  }

  .cash-payment-card .responsive-table,
  .cash-movements-card .responsive-table,
  .cash-closings-card .responsive-table {
    padding: 0 20px 22px;
  }

  .cash-payment-card .responsive-table table {
    min-width: 520px;
  }

  .cash-movements-card .responsive-table table {
    min-width: 780px;
  }

  .cash-closings-card .responsive-table table {
    min-width: 820px;
  }
}

/* Reportes y gráficos */
.reports-topbar {
  align-items: flex-start;
  gap: 20px;
}

.reports-filter-card {
  margin-bottom: 24px;
}

.reports-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr)) minmax(300px, auto);
  gap: 18px;
  align-items: end;
}

.reports-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.reports-stats-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.report-stat-card {
  min-height: 104px;
  padding: 18px 20px;
  gap: 14px;
  align-items: center;
}

.report-stat-card .icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  font-size: 24px;
}

.report-stat-card h3 {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .02em;
  margin-bottom: 7px;
}

.report-stat-card strong {
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.report-stat-card p {
  font-size: 12px;
  line-height: 1.3;
  margin: 0;
}

.reports-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 24px;
  margin-bottom: 26px;
}

.reports-grid-wide {
  grid-template-columns: minmax(0, 1fr) minmax(330px, .45fr);
}

.report-chart-card {
  padding-bottom: 28px;
  overflow: hidden;
}

.report-chart-card .table-card-header,
.reports-table-card .table-card-header {
  padding: 28px 30px 8px;
}

.report-bars-chart {
  display: grid;
  gap: 16px;
  padding: 12px 30px 4px;
  min-height: 230px;
  align-content: start;
}

.report-bar-row {
  display: grid;
  gap: 9px;
}

.report-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.report-bar-meta strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.report-bar-meta span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.report-bar-track {
  height: 14px;
  border-radius: 999px;
  background: #f2eadc;
  overflow: hidden;
  border: 1px solid #eadcc4;
}

.report-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
  min-width: 24px;
}

.report-empty-chart {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  color: var(--muted);
  font-weight: 800;
  background: #fffdf8;
  border: 1px dashed #e1d4bd;
  border-radius: 20px;
}

.report-summary-list {
  display: grid;
  gap: 14px;
  padding: 12px 30px 6px;
}

.report-summary-list > div {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #eadcc4;
  background: #fffdf8;
}

.report-summary-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.report-summary-list strong {
  color: var(--green-dark);
  line-height: 1.35;
}

.reports-table-card {
  margin-bottom: 26px;
}

.reports-table-card .responsive-table {
  padding: 0 30px 30px;
  overflow-x: auto;
}

.reports-table-card table {
  min-width: 880px;
  width: 100%;
}

.reports-table-card th,
.reports-table-card td {
  padding: 18px 20px;
}

.reports-table-card .empty-table {
  padding: 40px 22px;
  text-align: center;
  white-space: normal;
}

@media (max-width: 1280px) {
  .reports-stats-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .reports-grid,
  .reports-grid-wide {
    grid-template-columns: 1fr;
  }

  .reports-filter-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .reports-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .reports-topbar {
    flex-direction: column;
  }

  .reports-filter-grid,
  .reports-stats-grid {
    grid-template-columns: 1fr;
  }

  .report-chart-card .table-card-header,
  .reports-table-card .table-card-header {
    padding: 22px 20px 8px;
  }

  .report-bars-chart,
  .report-summary-list {
    padding: 10px 20px 0;
  }

  .report-bar-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .report-bar-meta span {
    text-align: left;
    white-space: normal;
  }

  .reports-table-card .responsive-table {
    padding: 0 20px 22px;
  }

  .reports-table-card table {
    min-width: 720px;
  }
}

/* Acciones del historial de cierres */
.cash-closings-card .responsive-table table {
  min-width: 1180px;
}

.cash-closings-card th:nth-child(1),
.cash-closings-card td:nth-child(1) { width: 12%; }

.cash-closings-card th:nth-child(2),
.cash-closings-card td:nth-child(2) { width: 15%; }

.cash-closings-card th:nth-child(3),
.cash-closings-card td:nth-child(3),
.cash-closings-card th:nth-child(4),
.cash-closings-card td:nth-child(4),
.cash-closings-card th:nth-child(5),
.cash-closings-card td:nth-child(5),
.cash-closings-card th:nth-child(6),
.cash-closings-card td:nth-child(6) {
  width: 12%;
  text-align: right;
}

.cash-closings-card th:nth-child(7),
.cash-closings-card td:nth-child(7) {
  width: 25%;
  text-align: left;
}

.cash-closing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 260px;
}

.cash-action-btn {
  border: 1px solid rgba(185, 120, 5, 0.22);
  background: #fffaf0;
  color: #9a6404;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.cash-action-btn:hover {
  border-color: rgba(185, 120, 5, 0.45);
  background: #fff4d8;
}

.cash-action-btn.danger {
  color: var(--danger);
  border-color: rgba(186, 54, 54, 0.24);
  background: #fff5f5;
}

.cash-action-btn.danger:hover {
  background: #ffecec;
}

.cash-closing-modal-card {
  width: min(860px, 100%);
}

.cash-closing-detail {
  display: grid;
  gap: 22px;
}

.cash-closing-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cash-closing-summary-grid > div,
.cash-closing-readonly > div {
  border: 1px solid var(--line);
  background: #fbfbf7;
  border-radius: 16px;
  padding: 14px;
}

.cash-closing-summary-grid span,
.cash-closing-readonly span,
.cash-closing-notes span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cash-closing-summary-grid strong,
.cash-closing-readonly strong {
  color: var(--green-dark);
  font-size: 17px;
}

.cash-closing-notes {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--white);
}

.cash-closing-notes p {
  margin: 0;
  color: var(--green-dark);
  font-weight: 700;
  line-height: 1.55;
}

.cash-closing-readonly {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 860px) {
  .cash-closing-summary-grid,
  .cash-closing-readonly {
    grid-template-columns: 1fr;
  }

  .cash-closing-actions {
    min-width: 220px;
  }
}

/* Ajuste de botones en módulo Caja */
.cash-closings-card .responsive-table table {
  min-width: 1360px;
}

.cash-closings-card th:nth-child(7),
.cash-closings-card td:nth-child(7) {
  width: 34%;
  min-width: 380px;
}

.cash-closing-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 10px;
  min-width: 360px;
  width: 100%;
  align-items: center;
}

.cash-action-btn {
  width: 100%;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.cash-panel .form-actions,
.cash-close-form .form-actions {
  gap: 12px;
  flex-wrap: wrap;
}

.cash-panel .form-actions .btn-primary,
.cash-panel .form-actions .btn-secondary,
.cash-close-form .form-actions .btn-primary {
  min-width: 170px;
  justify-content: center;
  text-align: center;
}

@media (max-width: 700px) {
  .cash-closings-card .responsive-table table {
    min-width: 1180px;
  }

  .cash-closing-actions {
    grid-template-columns: repeat(2, minmax(118px, 1fr));
    min-width: 280px;
  }

  .cash-action-btn {
    min-height: 40px;
    padding: 10px 12px;
  }
}

/* Corrección final: botones del módulo Caja debajo y con buen ancho */
.cash-layout {
  align-items: stretch;
}

.cash-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
}

.cash-panel .field,
.cash-panel .cash-two-columns {
  margin: 0;
}

.cash-panel .form-actions {
  width: 100%;
  margin-top: auto;
  padding-top: 22px;
  padding-bottom: 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  justify-content: stretch;
  align-items: stretch;
}

#cashExpenseForm .form-actions {
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1fr);
}

.cash-panel .form-actions .btn-primary,
.cash-panel .form-actions .btn-secondary {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0 18px;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 900px) {
  #cashExpenseForm .form-actions {
    grid-template-columns: 1fr;
  }

  .cash-panel .form-actions .btn-primary,
  .cash-panel .form-actions .btn-secondary {
    white-space: normal;
  }
}

/* Usuarios */
.users-topbar {
  align-items: flex-start;
  gap: 20px;
}

.users-stats-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.user-stat-card {
  min-height: 104px;
  padding: 18px 20px;
  gap: 14px;
  align-items: center;
}

.user-stat-card .icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  font-size: 24px;
}

.user-stat-card h3 {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .02em;
  margin-bottom: 7px;
}

.user-stat-card strong {
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.user-stat-card p {
  font-size: 12px;
  line-height: 1.3;
  margin: 0;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.user-form-card .field textarea {
  min-height: 104px;
}

.users-form-actions {
  padding: 22px 0 0;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.users-form-actions .btn-primary,
.users-form-actions .btn-secondary,
.users-form-actions .btn-light {
  min-width: 150px;
}

.current-user-card {
  display: grid;
  gap: 14px;
  text-align: center;
  position: sticky;
  top: 24px;
}

.current-user-avatar {
  width: 82px;
  height: 82px;
  margin: 0 auto 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #0b3d31, #031f18);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(3, 31, 24, .22);
}

.current-user-card h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 22px;
}

.current-user-card p {
  margin: -8px 0 4px;
  color: var(--muted);
  font-weight: 800;
}

.current-user-details {
  display: grid;
  gap: 10px;
  text-align: left;
}

.current-user-details > div {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
}

.current-user-details span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.current-user-details strong {
  color: var(--green-dark);
  word-break: break-word;
}

.current-user-card small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.users-filter-card {
  margin-bottom: 24px;
}

.users-filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(180px, .8fr) minmax(160px, .7fr) auto;
  gap: 18px;
  align-items: end;
}

.users-filter-actions {
  display: flex;
  justify-content: flex-end;
}

.users-filter-actions .btn-secondary {
  min-width: 150px;
}

.users-table-card .responsive-table {
  overflow-x: auto;
}

.users-table-card table {
  min-width: 980px;
}

.users-table-card th,
.users-table-card td {
  padding: 16px 20px;
}

.user-table-name,
.user-table-contact {
  display: grid;
  gap: 5px;
}

.user-table-name strong,
.user-table-contact strong {
  color: var(--green-dark);
}

.user-table-name span,
.user-table-contact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.users-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 250px;
}

.users-row-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-dark);
  background: #fffdf8;
  font-weight: 900;
  cursor: pointer;
}

.users-row-actions button:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(198, 138, 25, .12);
}

.users-row-actions button.danger {
  color: var(--danger);
  background: #fff7f4;
}

.user-modal-card {
  width: min(820px, 100%);
}

@media (max-width: 1180px) {
  .users-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .users-layout,
  .users-filter-grid {
    grid-template-columns: 1fr;
  }

  .current-user-card {
    position: static;
  }

  .users-filter-actions {
    justify-content: stretch;
  }

  .users-filter-actions .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .users-topbar,
  .users-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .users-stats-grid,
  .user-form-card .two-columns {
    grid-template-columns: 1fr;
  }

  .users-form-actions .btn-primary,
  .users-form-actions .btn-secondary,
  .users-form-actions .btn-light {
    width: 100%;
  }

  .users-table-card table,
  .users-table-card thead,
  .users-table-card tbody,
  .users-table-card tr,
  .users-table-card th,
  .users-table-card td {
    display: block;
  }

  .users-table-card table {
    min-width: 0;
  }

  .users-table-card thead {
    display: none;
  }

  .users-table-card tbody {
    display: grid;
    gap: 14px;
    padding: 14px;
  }

  .users-table-card tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
  }

  .users-table-card td {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }

  .users-table-card td:last-child {
    border-bottom: 0;
  }

  .users-table-card td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 900;
  }

  .users-row-actions {
    min-width: 0;
  }
}

/* Ajuste visual: listado de usuarios más amplio y cómodo */
.users-table-card {
  width: 100%;
  padding: 26px 28px 30px;
  margin-top: 4px;
}

.users-table-card .table-card-header {
  margin-bottom: 22px;
  align-items: flex-start;
  gap: 16px;
}

.users-table-card .table-card-header h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.users-table-card .table-card-header p {
  font-size: 14px;
  line-height: 1.5;
}

.users-table-card .responsive-table {
  width: 100%;
  padding-bottom: 6px;
}

.users-table-card table {
  width: 100%;
  min-width: 1120px;
  table-layout: auto;
}

.users-table-card th,
.users-table-card td {
  padding: 18px 22px;
  vertical-align: middle;
}

.users-table-card th:nth-child(1),
.users-table-card td:nth-child(1) {
  min-width: 230px;
}

.users-table-card th:nth-child(2),
.users-table-card td:nth-child(2) {
  min-width: 250px;
}

.users-table-card th:nth-child(5),
.users-table-card td:nth-child(5) {
  min-width: 190px;
}

.users-table-card th:nth-child(6),
.users-table-card td:nth-child(6) {
  min-width: 300px;
}

.users-row-actions {
  min-width: 300px;
  gap: 10px;
}

.users-row-actions button {
  min-width: 82px;
  min-height: 38px;
  padding: 0 14px;
}

@media (max-width: 1180px) {
  .users-table-card {
    padding: 24px 22px 28px;
  }

  .users-table-card table {
    min-width: 1050px;
  }
}

@media (max-width: 760px) {
  .users-table-card {
    padding: 20px 14px 22px;
  }

  .users-table-card .table-card-header {
    margin-bottom: 16px;
  }

  .users-table-card tbody {
    padding: 0;
  }

  .users-table-card td {
    grid-template-columns: 120px 1fr;
    padding: 15px 14px;
  }

  .users-row-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .users-row-actions button {
    width: 100%;
  }
}


/* Auditoría */
.audit-stats-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.audit-filter-panel,
.audit-list-panel { width: 100%; }
.audit-filter-grid { grid-template-columns: 1.4fr 0.9fr 0.9fr 0.8fr; align-items: end; }
.audit-table-wrapper { width: 100%; overflow-x: auto; padding: 6px; }
.audit-table-wrapper table { min-width: 980px; table-layout: auto; }
.audit-table-wrapper th:nth-child(1), .audit-table-wrapper td:nth-child(1) { min-width: 145px; }
.audit-table-wrapper th:nth-child(2), .audit-table-wrapper td:nth-child(2) { min-width: 170px; }
.audit-table-wrapper th:nth-child(3), .audit-table-wrapper td:nth-child(3) { min-width: 120px; }
.audit-table-wrapper th:nth-child(4), .audit-table-wrapper td:nth-child(4) { min-width: 150px; }
.audit-table-wrapper th:nth-child(5), .audit-table-wrapper td:nth-child(5) { min-width: 280px; white-space: normal; }
.audit-table-wrapper th:nth-child(6), .audit-table-wrapper td:nth-child(6) { min-width: 130px; }
.audit-table-wrapper small { color: #6b7280; font-weight: 600; }
.btn-secondary.danger { border-color: #fecaca; color: #b91c1c; background: #fff5f5; }
@media (max-width: 1024px) {
  .audit-stats-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .audit-filter-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 640px) {
  .audit-stats-grid, .audit-filter-grid { grid-template-columns: 1fr; }
}


/* Auditoría mejor estructurada */
.audit-page {
  max-width: 1480px;
}

.audit-topbar {
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.page-eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 7px;
  color: var(--gold-dark, #9a6404);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.audit-header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.audit-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
  box-shadow: 0 12px 30px rgba(3, 31, 24, .07);
}

.audit-summary-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #0b3d31;
  color: #fff;
  font-size: 22px;
  box-shadow: 0 10px 20px rgba(3, 31, 24, .18);
}

.audit-summary-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.audit-summary-card strong {
  display: block;
  color: var(--green-dark);
  font-size: 25px;
  line-height: 1;
}

.audit-summary-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.audit-panel {
  width: 100%;
  margin-bottom: 24px;
  padding: 26px 28px 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 14px 34px rgba(3, 31, 24, .08);
}

.audit-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.audit-panel-header h2 {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 23px;
}

.audit-panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.audit-filter-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.6fr) minmax(180px, .8fr) minmax(190px, .9fr) minmax(170px, .75fr);
  gap: 18px;
  align-items: end;
}

.audit-field {
  display: grid;
  gap: 8px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.audit-field input,
.audit-field select {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  padding: 0 14px;
  color: var(--green-dark);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.audit-history-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.audit-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.audit-history-actions .btn-secondary,
.audit-panel-header > .btn-secondary {
  min-width: 145px;
  min-height: 42px;
  justify-content: center;
}

.audit-table-wrapper {
  width: 100%;
  overflow-x: auto;
  padding: 4px 2px 8px;
}

.audit-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.audit-table th,
.audit-table td {
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.audit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff8e8;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-align: left;
  text-transform: uppercase;
}

.audit-table tbody tr:hover {
  background: #fffdf8;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) { min-width: 160px; }
.audit-table th:nth-child(2),
.audit-table td:nth-child(2) { min-width: 210px; }
.audit-table th:nth-child(3),
.audit-table td:nth-child(3) { min-width: 145px; }
.audit-table th:nth-child(4),
.audit-table td:nth-child(4) { min-width: 170px; }
.audit-table th:nth-child(5),
.audit-table td:nth-child(5) { min-width: 360px; white-space: normal; }
.audit-table th:nth-child(6),
.audit-table td:nth-child(6) { min-width: 165px; }

.audit-date-text,
.audit-ref-text {
  color: var(--green-dark);
  font-weight: 800;
}

.audit-user-cell {
  display: grid;
  gap: 5px;
}

.audit-user-cell strong {
  color: var(--green-dark);
}

.audit-user-cell small {
  color: var(--muted);
  font-weight: 800;
}

.audit-module-badge,
.audit-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.audit-module-badge {
  border: 1px solid rgba(11, 61, 49, .14);
  background: #eef8f2;
  color: var(--green-dark);
}

.audit-action-badge {
  border: 1px solid rgba(198, 138, 25, .25);
  background: #fff5dc;
  color: #9a6404;
}

.audit-detail-cell {
  color: #374151;
  font-weight: 700;
  line-height: 1.45;
}

.audit-table .empty-state {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  background: #fffdf8;
}

.btn-secondary.danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff5f5;
}

.btn-secondary.danger:hover {
  background: #ffecec;
}

@media (max-width: 1180px) {
  .audit-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-filter-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .audit-topbar,
  .audit-panel-header,
  .audit-history-header {
    flex-direction: column;
    align-items: stretch;
  }

  .audit-header-actions,
  .audit-history-actions {
    justify-content: stretch;
  }

  .audit-header-actions .new-product,
  .audit-history-actions .btn-secondary,
  .audit-panel-header > .btn-secondary {
    width: 100%;
  }

  .audit-summary-grid,
  .audit-filter-grid {
    grid-template-columns: 1fr;
  }

  .audit-panel {
    padding: 22px 16px 24px;
    border-radius: 20px;
  }

  .audit-table,
  .audit-table thead,
  .audit-table tbody,
  .audit-table tr,
  .audit-table th,
  .audit-table td {
    display: block;
  }

  .audit-table {
    min-width: 0;
  }

  .audit-table thead {
    display: none;
  }

  .audit-table tbody {
    display: grid;
    gap: 14px;
  }

  .audit-table tr {
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 22px rgba(3, 31, 24, .06);
  }

  .audit-table td {
    display: grid;
    grid-template-columns: 122px 1fr;
    gap: 12px;
    padding: 14px 15px;
    border-bottom: 1px solid var(--line);
  }

  .audit-table td:last-child {
    border-bottom: 0;
  }

  .audit-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
}

/* Configuración */
.settings-topbar {
  align-items: flex-start;
  gap: 18px;
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin: 26px 0 22px;
}

.settings-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(3, 31, 24, .06);
}

.settings-summary-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
  border-radius: 16px;
  color: var(--green-dark);
  background: #fff2cf;
  font-size: 22px;
}

.settings-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.settings-summary-card strong {
  display: block;
  margin-top: 2px;
  color: var(--green-dark);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}

.settings-summary-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.settings-form-card {
  display: grid;
  gap: 28px;
  padding: 28px;
}

.settings-section-block {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.settings-section-block:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.settings-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-grid .full-width {
  grid-column: 1 / -1;
}

.settings-switch-field {
  justify-content: end;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-switch {
  position: relative;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: #d8d8d8;
  transition: .2s ease;
}

.settings-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
  transition: .2s ease;
}

.switch-row input:checked + .settings-switch {
  background: var(--green-dark);
}

.switch-row input:checked + .settings-switch::after {
  transform: translateX(22px);
}

.switch-row strong {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.settings-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

.settings-form-actions button,
.settings-backup-actions button,
.settings-upload-btn,
.settings-maintenance-actions button {
  min-height: 44px;
  min-width: 150px;
  justify-content: center;
}

.settings-side-panel {
  display: grid;
  gap: 18px;
}

.settings-card {
  padding: 24px;
}

.settings-backup-actions,
.settings-maintenance-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.settings-upload-btn {
  display: inline-flex;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.settings-help-text {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.danger-zone-card {
  border-color: #ffd6d6;
  background: #fffdfd;
}

.settings-status-card {
  text-align: center;
}

.settings-status-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border-radius: 18px;
  color: #fff;
  background: var(--green-dark);
  font-size: 24px;
  font-weight: 900;
}

.settings-status-card h2 {
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 900;
}

.settings-status-card p {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

@media (max-width: 1240px) {
  .settings-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-side-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .settings-grid.three-columns,
  .settings-grid.two-columns,
  .settings-side-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .settings-topbar,
  .settings-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .settings-summary-grid {
    grid-template-columns: 1fr;
  }
  .settings-form-card,
  .settings-card {
    padding: 20px 16px;
    border-radius: 20px;
  }
  .settings-form-actions button,
  .settings-backup-actions button,
  .settings-upload-btn,
  .settings-maintenance-actions button,
  .settings-topbar .new-product {
    width: 100%;
  }
}

/* Ajuste general del menú lateral */
.sidebar {
  width: 230px;
  padding: 18px 14px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.content {
  width: calc(100% - 230px);
  margin-left: 230px;
}

.logo {
  margin-bottom: 34px;
}

.logo-image,
.logo img {
  max-width: 132px;
}

.menu {
  gap: 6px;
  margin-top: 20px;
}

.menu a {
  min-height: 38px;
  padding: 0 11px;
  gap: 9px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.menu-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

.sidebar-card {
  margin-top: 18px;
  padding: 14px 15px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.35;
}

.sidebar-card .shield,
.sidebar-card span {
  font-size: 24px;
}

@media (max-height: 760px) and (min-width: 1101px) {
  .sidebar {
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .logo {
    margin-bottom: 24px;
  }

  .logo-image,
  .logo img {
    max-width: 112px;
  }

  .menu a {
    min-height: 34px;
    font-size: 12.5px;
  }

  .menu {
    margin-top: 14px;
  }

  .sidebar-card {
    margin-top: 12px;
    padding: 11px 12px;
  }
}

@media (max-width: 1100px) {
  .sidebar {
    width: 100%;
    padding: 14px 18px;
  }

  .content {
    width: 100%;
    margin-left: 0;
  }

  .logo {
    justify-content: flex-start;
    margin-bottom: 20px;
  }

  .logo-image,
  .logo img {
    max-width: 120px;
  }

  .menu {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 16px;
  }

  .menu a {
    justify-content: flex-start;
    min-height: 40px;
    padding: 0 12px;
    white-space: normal;
  }

  .sidebar-card {
    display: none;
  }
}

@media (max-width: 560px) {
  .sidebar {
    padding: 12px;
  }

  .menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu a {
    min-height: 38px;
    padding: 0 10px;
    gap: 7px;
    font-size: 12.5px;
  }

  .menu-icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
  }
}

/* Botón cerrar sesión debajo del menú */
.sidebar-logout {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.logout-btn {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.48);
  transform: translateY(-1px);
}

.logout-icon {
  font-size: 16px;
  line-height: 1;
}

@media (max-height: 760px) and (min-width: 1101px) {
  .sidebar-logout {
    margin-top: 16px;
    padding-top: 14px;
  }

  .logout-btn {
    min-height: 38px;
    font-size: 12.5px;
  }
}

@media (max-width: 1100px) {
  .sidebar-logout {
    margin-top: 14px;
    padding-top: 12px;
  }

  .logout-btn {
    max-width: 220px;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .logout-btn {
    max-width: 100%;
  }
}


/* Login / acceso */
.login-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px;
  background: #f4f4f4;
}

.login-shell {
  width: min(900px, 100%);
  min-height: 470px;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}

.login-brand-card,
.login-form-card {
  box-shadow: none;
}

.login-brand-card {
  width: 40%;
  background: linear-gradient(180deg, #022d23, #00150f);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px;
}

.login-logo {
  width: 100%;
  max-width: 320px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .28));
}

.login-kicker,
.login-brand-card h1,
.login-brand-card p,
.login-benefits {
  display: none;
}

.login-form-card {
  width: 60%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 26px 30px;
}

.login-form-header,
.login-form,
.login-default-access,
.login-note {
  width: 100%;
  max-width: 360px;
}

.login-form-header {
  margin-bottom: 0;
}

.login-form-header h2 {
  margin: 0 0 8px;
  color: #111111;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
}

.login-form-header p,
.login-sub {
  margin: 0 0 18px;
  color: #666666;
  font-size: 15px;
}

.login-form {
  display: block;
}

.login-form .field {
  display: block;
  margin: 0;
}

.login-form .field > span,
.login-form .login-password-field > span {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  color: #222222;
  font-weight: 700;
  font-size: 14px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  min-height: auto;
  padding: 11px 12px;
  border: 1px solid #cccccc;
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #171717;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  border-color: #033b2d;
  box-shadow: 0 0 0 3px rgba(3, 59, 45, .12);
}

.password-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.password-control input {
  min-width: 0;
}

.password-control button {
  width: auto;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #cccccc;
  border-radius: 10px;
  background: #f7f7f7;
  color: #033b2d;
  cursor: pointer;
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 13px;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.password-control button:hover {
  background: #eef6f3;
  border-color: #033b2d;
}

.login-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 8px 0 12px;
  font-size: 14px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #555555;
  font-weight: 600;
  margin: 0;
  cursor: pointer;
}

.remember-me input {
  width: auto;
  margin: 0;
  accent-color: #033b2d;
}

.forgot-link {
  color: #b8860b;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.forgot-link:hover {
  text-decoration: underline;
}

.login-message {
  min-height: 18px;
  margin-bottom: 4px;
  color: #9b1c1c;
  font-weight: 700;
  font-size: 13px;
}

.login-message.success {
  color: #187044;
}

.login-submit-btn {
  width: 100%;
  min-height: auto;
  padding: 12px 13px;
  border: none;
  border-radius: 10px;
  background: #033b2d;
  color: #ffffff;
  cursor: pointer;
  margin-top: 10px;
  font-weight: 800;
  font-size: 15px;
  transition: background .3s ease, transform .2s ease, box-shadow .2s ease;
}

.login-submit-btn:hover {
  background: #05543f;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(3, 59, 45, .18);
}

.login-default-access,
.login-note {
  margin: 16px 0 0;
  color: #666666;
  font-size: 13px;
  line-height: 1.45;
}

.login-default-access {
  padding: 11px 13px;
  border-radius: 10px;
  background: #f8f1df;
  color: #7a540d;
  font-weight: 700;
}

.login-default-access:empty {
  display: none;
}

@media (max-width: 900px) {
  .login-page {
    padding: 18px;
  }

  .login-shell {
    min-height: auto;
    flex-direction: column;
  }

  .login-brand-card,
  .login-form-card {
    width: 100%;
  }

  .login-brand-card {
    min-height: 190px;
  }

  .login-logo {
    max-width: 220px;
  }
}

@media (max-width: 560px) {
  .login-page {
    padding: 12px;
  }

  .login-shell {
    border-radius: 16px;
  }

  .login-brand-card,
  .login-form-card {
    padding: 22px;
  }

  .login-brand-card {
    min-height: 150px;
  }

  .login-form-header h2 {
    font-size: 28px;
  }

  .password-control {
    grid-template-columns: 1fr;
  }

  .password-control button {
    width: 100%;
  }

  .login-options-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Auditoría con estilo visual alineado a Reportes */
.audit-report-style .audit-topbar {
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.audit-report-style .audit-summary-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.audit-report-style .audit-summary-card {
  min-height: 104px;
  padding: 18px 20px;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .03);
}

.audit-report-style .audit-summary-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  background: #edf6e9;
  color: var(--gold);
  box-shadow: none;
  font-size: 24px;
}

.audit-report-style .audit-summary-card span {
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .02em;
  margin-bottom: 7px;
}

.audit-report-style .audit-summary-card strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.audit-report-style .audit-summary-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin: 0;
}

.audit-report-style .audit-panel {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .03);
}

.audit-report-style .audit-filter-panel {
  padding: 28px;
  margin-bottom: 24px;
}

.audit-report-style .audit-panel-header {
  margin-bottom: 22px;
}

.audit-report-style .audit-panel-header h2 {
  color: var(--green-dark);
  font-size: 20px;
}

.audit-report-style .audit-panel-header p {
  color: var(--muted);
  font-weight: 700;
}

.audit-report-style .audit-filter-grid {
  grid-template-columns: minmax(320px, 1.6fr) minmax(180px, .8fr) minmax(190px, .9fr) minmax(170px, .75fr);
  gap: 18px;
}

.audit-report-style .audit-field {
  color: #14231d;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.audit-report-style .audit-field input,
.audit-report-style .audit-field select {
  min-height: 50px;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}

.audit-report-style .audit-field input:focus,
.audit-report-style .audit-field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(198, 138, 25, .14);
  outline: none;
}

.audit-report-style .audit-list-panel {
  padding: 0;
  margin-bottom: 26px;
  overflow: hidden;
}

.audit-report-style .audit-list-panel .audit-panel-header {
  padding: 28px 30px 8px;
  margin-bottom: 0;
  border-bottom: 0;
}

.audit-report-style .audit-table-wrapper {
  padding: 0 30px 30px;
  overflow-x: auto;
}

.audit-report-style .audit-table {
  min-width: 880px;
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.audit-report-style .audit-table th,
.audit-report-style .audit-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.audit-report-style .audit-table th {
  position: static;
  background: var(--white);
  color: #102018;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.audit-report-style .audit-table tbody tr:hover {
  background: #fffdf8;
}

.audit-report-style .audit-module-badge {
  border: 1px solid #eadcc4;
  background: #fffdf8;
  color: var(--green-dark);
}

.audit-report-style .audit-action-badge {
  border: 1px solid rgba(198, 138, 25, .25);
  background: #fff5dc;
  color: #9a6404;
}

.audit-report-style .audit-table .empty-state {
  padding: 40px 22px;
  text-align: center;
  white-space: normal;
  background: var(--white);
}

@media (max-width: 1280px) {
  .audit-report-style .audit-summary-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .audit-report-style .audit-filter-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .audit-report-style .audit-topbar,
  .audit-report-style .audit-panel-header,
  .audit-report-style .audit-history-header {
    flex-direction: column;
  }

  .audit-report-style .audit-summary-grid,
  .audit-report-style .audit-filter-grid {
    grid-template-columns: 1fr;
  }

  .audit-report-style .audit-filter-panel {
    padding: 22px 20px;
  }

  .audit-report-style .audit-list-panel .audit-panel-header {
    padding: 22px 20px 8px;
  }

  .audit-report-style .audit-table-wrapper {
    padding: 0 20px 22px;
  }
}

.cash-required-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #e7ddc7;
  border-left: 5px solid #b8860b;
  border-radius: 16px;
  background: #fff8e5;
  color: #25352b;
  box-shadow: 0 10px 24px rgba(15, 81, 50, 0.08);
}

.cash-required-notice strong {
  color: #0f5132;
  font-weight: 900;
}

.cash-required-notice span {
  color: #6e7d72;
  font-weight: 700;
  flex: 1;
}

.cash-required-notice a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: #0f5132;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 720px) {
  .cash-required-notice {
    align-items: flex-start;
    flex-direction: column;
  }
}



/* Ajuste de separación de botones en Kardex */
.kardex-page .action-row {
  gap: 14px;
  flex-wrap: wrap;
}

.kardex-page .action-row .new-product {
  margin-left: 0;
}

@media (max-width: 720px) {
  .kardex-page .action-row {
    justify-content: flex-start;
    margin-top: 0;
    gap: 12px;
  }
}

/* Kardex */
.secondary-action {
  text-decoration: none;
}

.kardex-filters {
  align-items: stretch;
}

/* Ajuste de espacio en encabezado de movimientos Kardex */
.kardex-table-card .table-card-header {
  align-items: flex-start;
  padding: 24px 28px 18px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.kardex-table-card .table-card-header h2 {
  margin: 0 0 10px;
  line-height: 1.25;
}

.kardex-table-card .table-card-header p {
  margin: 0;
  line-height: 1.45;
}

.kardex-table-card .responsive-table {
  border-top: 0;
}

.kardex-table-card .responsive-table {
  overflow-x: auto;
}

.kardex-table-card table {
  min-width: 980px;
}

.kardex-table-card th:nth-child(1),
.kardex-table-card td:nth-child(1) { width: 12%; }
.kardex-table-card th:nth-child(2),
.kardex-table-card td:nth-child(2) { width: 20%; }
.kardex-table-card th:nth-child(3),
.kardex-table-card td:nth-child(3) { width: 10%; }
.kardex-table-card th:nth-child(4),
.kardex-table-card td:nth-child(4),
.kardex-table-card th:nth-child(5),
.kardex-table-card td:nth-child(5),
.kardex-table-card th:nth-child(6),
.kardex-table-card td:nth-child(6) { width: 10%; }
.kardex-table-card th:nth-child(7),
.kardex-table-card td:nth-child(7) { width: 13%; }
.kardex-table-card th:nth-child(8),
.kardex-table-card td:nth-child(8) { width: 15%; }

.kardex-table-card .product-name {
  font-weight: 800;
  color: var(--text);
}

.kardex-table-card .price-mode {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .kardex-table-card table,
  .kardex-table-card thead,
  .kardex-table-card tbody,
  .kardex-table-card tr,
  .kardex-table-card th,
  .kardex-table-card td {
    display: block;
    width: 100%;
  }

  .kardex-table-card table {
    min-width: 0;
  }

  .kardex-table-card thead {
    display: none;
  }

  .kardex-table-card tr {
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
  }

  .kardex-table-card td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    text-align: right;
  }

  .kardex-table-card td::before {
    content: attr(data-label);
    font-weight: 800;
    color: var(--muted);
    text-align: left;
  }
}


/* Ajustes de espacio para página Reportes */
.reports-topbar {
  margin-bottom: 22px;
}

.reports-filter-card {
  padding: 24px 26px;
  margin-bottom: 24px;
}

.reports-filter-card .form-section-title {
  margin-bottom: 20px;
}

.reports-filter-grid {
  gap: 18px 22px;
}

.reports-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.report-stat-card {
  min-height: 116px;
  padding: 20px 22px;
}

.reports-grid,
.reports-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 26px;
  margin-bottom: 30px;
}

.report-chart-card,
.reports-table-card {
  border-radius: 18px;
}

.report-chart-card .table-card-header,
.reports-table-card .table-card-header {
  padding: 26px 30px 14px;
}

.report-chart-card .table-card-header h2,
.reports-table-card .table-card-header h2 {
  margin-bottom: 8px;
  line-height: 1.25;
}

.report-chart-card .table-card-header p,
.reports-table-card .table-card-header p {
  line-height: 1.45;
}

.report-bars-chart {
  padding: 16px 30px 26px;
  min-height: 220px;
}

.report-summary-list {
  padding: 16px 30px 26px;
}

.reports-table-card {
  margin-bottom: 30px;
}

.reports-table-card .responsive-table {
  padding: 0 30px 30px;
}

@media (max-width: 760px) {
  .reports-filter-card {
    padding: 22px 20px;
  }

  .reports-grid,
  .reports-grid-wide {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .report-chart-card .table-card-header,
  .reports-table-card .table-card-header {
    padding: 22px 20px 12px;
  }

  .report-bars-chart,
  .report-summary-list {
    padding: 14px 20px 22px;
  }
}


/* Reportes: stat cards más amplias */
.reports-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 34px;
}

.report-stat-card {
  min-height: 138px;
  padding: 26px 28px;
  gap: 18px;
  align-items: center;
}

.report-stat-card .icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
}

.report-stat-card h3 {
  margin-bottom: 9px;
  line-height: 1.3;
}

.report-stat-card strong {
  font-size: 24px;
  line-height: 1.2;
  margin-bottom: 8px;
  word-break: break-word;
}

.report-stat-card p {
  line-height: 1.45;
}

@media (max-width: 760px) {
  .reports-stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .report-stat-card {
    min-height: 124px;
    padding: 22px 24px;
  }
}

/* Reportes: stat cards más anchas sin cambiar tamaño de letra */
.reports-stats-grid {
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 28px;
  align-items: stretch;
}

.report-stat-card {
  padding-left: 36px;
  padding-right: 36px;
  min-width: 0;
}

.report-stat-card:last-child {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .reports-stats-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .report-stat-card:last-child {
    grid-column: auto;
  }
}

/* Reportes: ancho mínimo 300px para stat cards */
.reports-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  margin-bottom: 32px;
}

.report-stat-card {
  padding-left: 28px;
  padding-right: 28px;
  min-height: 132px;
}

.report-stat-card:last-child {
  grid-column: auto;
}

@media (max-width: 760px) {
  .reports-stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}


/* Stat cards globales: mismo tamaño visual que Reportes */
.stats-grid,
.provider-summary,
.cash-stats-grid,
.user-stats-grid,
.settings-summary-grid,
.audit-summary-grid,
.reports-stats-grid,
.kardex-stats {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  margin-bottom: 32px;
}

.stat-card,
.provider-stat-card,
.inventory-stat-card,
.cash-stat-card,
.report-stat-card,
.user-stat-card,
.settings-summary-card,
.audit-summary-card,
.audit-report-style .audit-summary-card {
  min-height: 132px;
  padding: 26px 28px;
  gap: 18px;
  align-items: center;
}

.stat-card .icon,
.inventory-stat-card .icon,
.report-stat-card .icon,
.user-stat-card .icon,
.audit-summary-icon,
.audit-report-style .audit-summary-icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  font-size: 24px;
}

.stat-card .icon img,
.inventory-stat-card .icon img {
  width: 42px !important;
  height: 42px !important;
}

.stat-card h3,
.inventory-stat-card h3,
.report-stat-card h3,
.user-stat-card h3,
.provider-stat-card h3,
.cash-stat-card h3,
.settings-summary-card span,
.audit-summary-card span,
.audit-report-style .audit-summary-card span {
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 9px;
  letter-spacing: .02em;
}

.stat-card strong,
.inventory-stat-card strong,
.report-stat-card strong,
.user-stat-card strong,
.provider-stat-card strong,
.cash-stat-card strong,
.settings-summary-card strong,
.audit-summary-card strong,
.audit-report-style .audit-summary-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  margin-bottom: 8px;
  word-break: break-word;
}

.stat-card p,
.inventory-stat-card p,
.report-stat-card p,
.user-stat-card p,
.provider-stat-card p,
.cash-stat-card p,
.settings-summary-card p,
.audit-summary-card p,
.audit-report-style .audit-summary-card p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.report-stat-card:last-child {
  grid-column: auto;
}

@media (max-width: 760px) {
  .stats-grid,
  .provider-summary,
  .cash-stats-grid,
  .user-stats-grid,
  .settings-summary-grid,
  .audit-summary-grid,
  .reports-stats-grid,
  .kardex-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-card,
  .provider-stat-card,
  .inventory-stat-card,
  .cash-stat-card,
  .report-stat-card,
  .user-stat-card,
  .settings-summary-card,
  .audit-summary-card,
  .audit-report-style .audit-summary-card {
    min-height: 124px;
    padding: 22px 24px;
  }
}

/* Campos editables en mayúscula */
input[type="text"]:not([id*="Search"]):not([id*="search"]):not([name*="search"]):not([placeholder*="Buscar"]):not([placeholder*="buscar"]),
textarea {
  text-transform: uppercase;
}

input[type="email"],
input[type="password"],
.login-page input,
.search-box input,
.filters input,
.kardex-filters input {
  text-transform: none;
}

/* Exclusión reforzada para login: usuario y contraseña no van en mayúscula */
.login-page #loginUser,
.login-page #loginPassword,
input#loginUser,
input#loginPassword {
  text-transform: none !important;
}

/* Estabilidad visual al cargar datos desde Cloudflare D1 */
html {
  scroll-behavior: auto !important;
}

body.server-loading .content {
  opacity: 0;
  pointer-events: none;
}

body .content {
  transition: opacity 0.12s ease;
}
