:root {
  --sms-orange: #ff5b00;
  --sms-orange-dark: #e24d00;
  --sms-orange-soft: #fff1e8;
  --sms-bg: #f4f6f9;
  --sms-surface: #fff;
  --sms-border: #e6ebf2;
  --sms-text: #0f172a;
  --sms-muted: #64748b;
  --sms-shadow: 0 14px 34px rgba(15, 23, 42, .08)
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--sms-bg);
  color: var(--sms-text)
}

a {
  text-decoration: none
}

.btn-sms {
  background: linear-gradient(180deg, var(--sms-orange), var(--sms-orange-dark));
  border: none;
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 91, 0, .18)
}

.btn-sms:hover,
.btn-sms:focus {
  color: #fff
}

.sms-link {
  color: var(--sms-orange)
}

.text-muted {
  color: var(--sms-muted) !important
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--sms-bg)
}

.login-composition {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .78fr;
  gap: 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--sms-shadow);
  border: 1px solid var(--sms-border);
  background: #fff
}

.login-brand-panel,
.login-form-panel {
  position: relative;
  min-height: 560px
}

.login-brand-panel {
  color: #fff
}

.login-brand-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 91, 0, .95), rgba(229, 74, 0, .88)), url("../images/warehouse.avif");
  background-size: cover;
  background-position: center
}


.login-logo-icon {
  height: 52px;
  width: auto;
  object-fit: contain
}

.login-wordmark {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em
}

.login-brand-content {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 42px 46px;
  display: flex;
  flex-direction: column
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 16px
}

.login-logo {
  width: 178px;
  height: auto;
  object-fit: contain
}

.login-pipe {
  width: 1px;
  height: 34px;
  background: rgba(255, 255, 255, .58)
}

.login-sms {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em
}

.login-copy {
  margin-top: auto;
  max-width: 430px;
  padding-bottom: 40px
}

.login-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, .10)
}

.login-copy h1 {
  font-size: 29px;
  line-height: 1.08;
  letter-spacing: -.04em;
  margin: 0 0 14px
}

.login-copy p {
  font-size: 16px;
  line-height: 1.48;
  margin: 0;
  max-width: 390px
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: 30px;
  background: #fff
}

.login-card {
  width: 100%;
  max-width: 388px;
  padding: 27px 29px 20px;
  border: 1px solid var(--sms-border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .045)
}

.login-card h2 {
  font-size: 25px;
  line-height: 1.05;
  letter-spacing: -.04em;
  margin: 0 0 8px;
  text-align: center
}

.login-card>p {
  text-align: center;
  font-size: 13.5px
}

.login-card .form-label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px
}

.login-card .form-control {
  height: 42px;
  border-color: #dbe3ee;
  font-size: 13.5px
}

.login-card .input-group-text {
  background: #fff;
  border-color: #dbe3ee;
  min-width: 42px;
  justify-content: center;
  color: #475569
}

.login-card .btn {
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700
}

.login-card .form-check-label,
.login-card .sms-link {
  font-size: 12.5px
}

.login-divider {
  margin: 17px 0 15px;
  position: relative;
  text-align: center;
  color: var(--sms-muted);
  font-size: 12px
}

.login-divider:before,
.login-divider:after {
  content: "";
  position: absolute;
  top: 50%;
  width: 36%;
  height: 1px;
  background: var(--sms-border)
}

.login-divider:before {
  left: 0
}

.login-divider:after {
  right: 0
}

.login-divider span {
  display: inline-block;
  padding: 0 10px;
  background: #fff;
  position: relative;
  z-index: 1
}

.login-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--sms-border);
  text-align: center;
  font-size: 12.5px;
  color: var(--sms-muted)
}

.app-shell {
  min-height: 100vh
}

.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(180deg, var(--sms-orange), var(--sms-orange-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 91, 0, .18);
  position: sticky;
  top: 0;
  z-index: 10
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px
}

.topbar-right {
  justify-content: flex-end
}

.topbar-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px
}

.brand-logo {
  height: 28px;
  width: auto;
  max-width: 135px;
  object-fit: contain
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, .65)
}

.brand-sms {
  font-size: 18px;
  font-weight: 800
}

.notification-dot {
  position: absolute;
  top: -2px;
  right: -1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--sms-orange);
  font-size: 9px;
  font-weight: 800
}

.user-chip {
  height: 34px;
  padding: 2px 8px 2px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--sms-orange);
  font-size: 10px;
  font-weight: 800
}

.sidebar {
  position: fixed;
  top: 52px;
  left: 0;
  bottom: 0;
  width: 204px;
  padding: 14px 10px;
  background: #fff;
  border-right: 1px solid var(--sms-border);
  transition: .25s ease;
  overflow: auto
}

.side-link {
  width: 100%;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  color: #334155;
  margin-bottom: 6px;
  text-align: left
}

.side-link i {
  font-size: 18px
}

.side-link.active {
  background: var(--sms-orange-soft);
  color: var(--sms-orange);
  font-weight: 700
}

.content {
  margin-left: 204px;
  padding: 18px 22px 22px;
  transition: .25s ease
}

.app-shell.sidebar-collapsed .sidebar {
  transform: translateX(-100%)
}

.app-shell.sidebar-collapsed .content {
  margin-left: 0
}

.screen {
  display: none
}

.active-screen {
  display: block
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap
}

.filter-panel,
.brand-filter-panel,
.panel {
  background: #fff;
  border: 1px solid var(--sms-border);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .04)
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px
}

.kpi-card {
  min-height: 86px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--sms-border);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .04)
}

.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #eff6ff
}

.kpi-icon.success {
  background: #eaf8ef;
  color: #16a34a
}

.kpi-icon.danger {
  background: #fff1f1;
  color: #ef4444
}

.kpi-icon.warning {
  background: #fff4ea;
  color: #f97316
}

.kpi-icon.info {
  background: #edf4ff;
  color: #2563eb
}

.kpi-card span {
  display: block;
  font-size: 12px;
  color: var(--sms-muted)
}

.kpi-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  margin-top: 2px
}

.kpi-card small {
  display: block;
  font-size: 12px;
  color: var(--sms-muted);
  margin-top: 4px
}

.sparkline {
  margin-left: auto;
  width: 90px;
  height: 38px;
  border-radius: 10px;
  position: relative;
  overflow: hidden
}

.sparkline:before {
  content: "";
  position: absolute;
  inset: 12px 8px;
  background-repeat: no-repeat;
  background-size: 100% 100%
}

.sparkline.green:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40'%3E%3Cpath d='M0 30 C10 5, 20 35, 30 20 S50 25, 60 12 S80 35, 100 18' fill='none' stroke='%2322c55e' stroke-width='3'/%3E%3C/svg%3E")
}

.sparkline.red:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40'%3E%3Cpath d='M0 28 C10 35,20 6,30 14 S50 38,60 24 S80 8,100 20' fill='none' stroke='%23ef4444' stroke-width='3'/%3E%3C/svg%3E")
}

.sparkline.orange:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40'%3E%3Cpath d='M0 25 C10 15,20 36,30 14 S50 6,60 18 S80 38,100 12' fill='none' stroke='%23f97316' stroke-width='3'/%3E%3C/svg%3E")
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr .9fr;
  gap: 16px
}

.panel {
  padding: 18px
}

.panel h3 {
  font-size: 16px;
  margin: 0 0 14px;
  letter-spacing: -.02em
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px
}

.donut {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(#22c55e 0 344deg, #ef4444 344deg 355deg, #f97316 355deg 360deg);
  display: grid;
  place-items: center;
  position: relative
}

.donut:before {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: #fff
}

.donut span {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #475569;
  font-size: 18px
}

.donut b {
  font-size: 38px;
  color: var(--sms-text)
}

.legend-list p,
.summary-list p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px
}

.green-dot {
  background: #22c55e
}

.red-dot {
  background: #ef4444
}

.orange-dot {
  background: #f97316
}

.bar-chart {
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 16px 8px 10px
}

.bar-chart div {
  flex: 1;
  min-width: 28px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, rgba(34, 197, 94, .85), rgba(34, 197, 94, .55));
  position: relative
}

.bar-chart div:nth-child(2) {
  background: linear-gradient(180deg, rgba(250, 204, 21, .9), rgba(250, 204, 21, .6))
}

.bar-chart div:nth-child(3) {
  background: linear-gradient(180deg, rgba(244, 63, 94, .9), rgba(244, 63, 94, .6))
}

.bar-chart div:nth-child(4) {
  background: linear-gradient(180deg, rgba(59, 130, 246, .9), rgba(59, 130, 246, .6))
}

.bar-chart div:nth-child(5) {
  background: linear-gradient(180deg, rgba(148, 163, 184, .85), rgba(148, 163, 184, .6))
}

.bar-chart span {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700
}

.bar-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--sms-muted)
}

.error-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px
}

.error-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--sms-border);
  font-size: 13px
}

.error-list em {
  font-style: normal;
  color: var(--sms-muted)
}

.filter-panel {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(140px, 1fr));
  gap: 12px;
  align-items: center
}

.products-filter {
  grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(150px, 1fr)) auto
}

.brand-filter-panel {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap
}

.brand-filter-panel .filter-search {
  min-width: 320px;
  flex: 1
}

.brand-filter-panel .form-select {
  max-width: 210px
}

.input-icon {
  display: flex;
  align-items: center;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  height: 42px
}

.input-icon i {
  padding: 0 14px;
  color: #64748b
}

.input-icon .form-control {
  border: none;
  box-shadow: none;
  height: 100%
}

.filter-search {
  min-width: 280px
}

.form-select,
.btn-sm {
  height: 42px;
  border-radius: 12px;
  font-size: 13px
}

.form-check-label {
  font-size: 13px;
  color: var(--sms-muted)
}

.table-responsive {
  overflow: auto
}

.table {
  margin-bottom: 0
}

.table thead th {
  font-size: 12px;
  color: #475569;
  border-bottom: 1px solid var(--sms-border);
  white-space: nowrap
}

.table td {
  font-size: 13px;
  color: #0f172a;
  border-color: #eef2f7;
  vertical-align: middle
}

.app-table tbody tr:hover {
  background: #fafbfd
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  font-size: 12.5px;
  color: var(--sms-muted)
}

.pagination .page-link {
  border: none;
  background: #fff;
  color: #475569;
  border-radius: 10px;
  padding: .45rem .75rem
}

.pagination .page-item.active .page-link {
  background: var(--sms-orange);
  color: #fff
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700
}

.status-ok {
  background: #ebf9ef;
  color: #16a34a
}

.status-error {
  background: #fff0f0;
  color: #ef4444
}

.status-run {
  background: #eef4ff;
  color: #2563eb
}

.btn-log,
.icon-btn {
  border: 1px solid var(--sms-border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: #475569
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px
}

.product-cell strong {
  display: block;
  font-size: 13px
}

.product-cell small {
  display: block;
  color: var(--sms-muted);
  font-size: 12px
}

.product-img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--sms-border)
}

.row-actions {
  display: flex;
  gap: 8px
}

.channel-logo,
.channel-ml {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  background: #fff5d5;
  color: #ad7a00
}

.channel-logo {
  background: #ffe6ef;
  color: #e11d48
}

.tree-line {
  padding-left: 28px;
  color: #475569;
  position: relative
}

.tree-line:before {
  content: "";
  position: absolute;
  left: 10px;
  top: -14px;
  width: 14px;
  height: 28px;
  border-left: 1px solid #d3dae5;
  border-bottom: 1px solid #d3dae5
}

.brand-action-group {
  display: flex;
  gap: 7px;
  flex-wrap: wrap
}

.brand-action-btn {
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--sms-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #334155
}

.brand-action-btn i {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px
}

.brand-action-btn .black {
  background: #111827
}

.brand-action-btn .orange {
  background: #ff7a12
}

.brand-action-btn .green {
  background: #16a34a
}

.brand-action-btn .purple {
  background: #7c3aed
}

.brand-action-btn .blue {
  background: #2563eb
}

.upload-modal {
  border: none;
  border-radius: 20px;
  overflow: hidden
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--sms-border)
}

.modal-header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--sms-muted)
}

.modal-body {
  padding: 22px
}

.upload-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr 1fr;
  gap: 18px
}

.upload-grid section {
  background: #fff;
  border: 1px solid var(--sms-border);
  border-radius: 16px;
  padding: 16px
}

.upload-grid h6 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 14px
}

.upload-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px
}

.upload-type {
  border: 1px solid var(--sms-border);
  background: #fff;
  border-radius: 14px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #334155
}

.upload-type.active {
  border-color: rgba(255, 91, 0, .38);
  box-shadow: inset 0 0 0 1px rgba(255, 91, 0, .2);
  background: #fff8f3
}

.upload-type i {
  font-size: 20px;
  color: var(--sms-orange)
}

.dropzone {
  border: 1.5px dashed #f6b58e;
  border-radius: 16px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fffaf6;
  padding: 18px;
  text-align: center
}

.dropzone i {
  font-size: 34px;
  color: var(--sms-orange)
}

.dropzone strong {
  font-size: 14px
}

.dropzone span,
.file-help {
  font-size: 12.5px;
  color: var(--sms-muted)
}

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--sms-border)
}

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

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

  .login-composition {
    grid-template-columns: 1fr .85fr
  }

  .brand-action-btn span {
    display: none
  }

  .brand-action-btn {
    padding: 0 7px
  }
}

@media(max-width:960px) {
  .sidebar {
    transform: translateX(-100%)
  }

  .content {
    margin-left: 0
  }

  .topbar-left,
  .topbar-right {
    min-width: auto
  }

  .login-composition {
    grid-template-columns: 1fr
  }

  .login-brand-panel {
    min-height: 360px
  }

  .login-form-panel {
    padding: 24px
  }

  .upload-grid {
    grid-template-columns: 1fr
  }

  .filter-panel,
  .products-filter {
    grid-template-columns: 1fr 1fr
  }

  .brand-filter-panel .form-select {
    max-width: none;
    flex: 1
  }
}

@media(max-width:640px) {
  .kpi-grid {
    grid-template-columns: 1fr
  }

  .filter-panel,
  .products-filter {
    grid-template-columns: 1fr
  }

  .login-screen {
    padding: 14px
  }

  .login-brand-content {
    padding: 30px
  }

  .login-copy {
    margin-top: 48px;
    padding-bottom: 0
  }

  .topbar-title {
    display: none
  }

  .brand-logo {
    max-width: 116px
  }

  .brand-sms {
    font-size: 16px
  }

  .user-chip span:not(.avatar) {
    display: none
  }

  .login-card {
    max-width: 100%;
    box-shadow: none;
    border: none
  }

  .login-form-panel {
    padding: 20px
  }

  .brand-filter-panel {
    display: grid;
    grid-template-columns: 1fr
  }

  .brand-filter-panel .filter-search {
    min-width: auto
  }

  .brand-filter-panel .btn {
    width: 100%
  }
}


/* Ajustes finales de UX */
.user-dropdown {
  display: flex;
  align-items: center;
  position: relative
}

.user-chip {
  border: 1px solid rgba(255, 255, 255, .22);
  cursor: pointer;
  font-family: inherit
}

.user-chip:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .18)
}

.user-menu {
  min-width: 210px;
  border: 1px solid var(--sms-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .14);
  font-size: 13px;
  margin-top: 8px
}

.user-menu .dropdown-item {
  border-radius: 10px;
  padding: 9px 10px;
  color: #334155
}

.user-menu .dropdown-item:hover {
  background: var(--sms-orange-soft);
  color: var(--sms-orange)
}

.table-footer {
  justify-content: space-between !important;
  align-items: center !important
}

.table-footer>span {
  order: 1;
  color: #64748b;
  font-size: 12.5px
}

.table-footer>nav,
.table-footer>.pagination {
  order: 2;
  margin-left: auto
}

.brand-table {
  min-width: 1180px
}

.brand-table th:nth-child(1),
.brand-table td:nth-child(1) {
  width: 20%
}

.brand-table th:nth-child(2),
.brand-table td:nth-child(2) {
  width: 8%
}

.brand-table th:nth-child(3),
.brand-table td:nth-child(3) {
  width: 22%
}

.brand-table th:nth-child(4),
.brand-table td:nth-child(4) {
  width: 10%
}

.brand-table th:nth-child(5),
.brand-table td:nth-child(5) {
  width: 40%;
  text-align: right
}

.brand-action-group {
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap
}

.brand-action-btn {
  white-space: nowrap
}

@media(max-width:900px) {
  .brand-table {
    min-width: 980px
  }

  .brand-action-group {
    justify-content: flex-start
  }

  .brand-table th:nth-child(5),
  .brand-table td:nth-child(5) {
    text-align: left
  }
}


/* v3 - Marcas con accordion y Productos según orden SMS actual */
.brand-panel {
  padding: 14px 18px 18px
}

.brand-grid-head {
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) 90px minmax(220px, 1fr) 130px minmax(620px, 1.45fr);
  gap: 16px;
  align-items: center;
  padding: 10px 8px 12px;
  border-bottom: 1px solid var(--sms-border);
  font-size: 12px;
  font-weight: 800;
  color: #475569
}

.brand-accordion {
  min-width: 1240px
}

.brand-accordion-item {
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: transparent
}

.brand-accordion-button {
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) 90px minmax(220px, 1fr) 130px minmax(620px, 1.45fr);
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 11px 8px;
  background: #fff !important;
  color: var(--sms-text);
  box-shadow: none !important;
  font-size: 13px
}

.brand-accordion-button::after {
  position: absolute;
  left: 8px;
  width: 14px;
  height: 14px;
  background-size: 14px
}

.brand-accordion-button .brand-name {
  padding-left: 28px
}

.brand-accordion-button:not(.collapsed) {
  color: var(--sms-text)
}

.brand-actions-cell {
  display: flex;
  justify-content: flex-end
}

.brand-accordion-body {
  padding: 0;
  background: #fff
}

.brand-child-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) 90px minmax(220px, 1fr) 130px minmax(620px, 1.45fr);
  gap: 16px;
  align-items: center;
  padding: 10px 8px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px
}

.brand-child-row>div:last-child {
  display: flex;
  justify-content: flex-end
}

.brand-child-name {
  padding-left: 28px
}

.brand-empty-row {
  padding: 12px 8px 12px 56px;
  color: var(--sms-muted);
  font-size: 12.5px;
  background: #fbfdff
}

.brand-action-group {
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap
}

.brand-action-btn {
  height: 30px
}

.brand-action-btn span {
  display: inline !important
}

.brand-action-btn {
  padding: 0 9px
}

.product-table {
  min-width: 1260px
}

.product-table th:nth-child(1),
.product-table td:nth-child(1) {
  width: 150px
}

.product-table th:nth-child(2),
.product-table td:nth-child(2) {
  width: 90px;
  text-align: center
}

.product-table th:nth-child(3),
.product-table td:nth-child(3) {
  min-width: 390px
}

.product-row {
  cursor: pointer
}

.product-row:hover {
  background: #fff8f3 !important
}

.sku-link {
  color: #2979ff;
  font-weight: 600
}

.channel-img {
  width: 28px;
  height: 28px;
  object-fit: contain
}

.product-name-cell {
  display: flex;
  align-items: center;
  gap: 12px
}

.product-name-cell>span {
  font-weight: 500
}

.product-detail-modal {
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .24)
}

.product-modal-header {
  background: linear-gradient(180deg, #fff, #fff8f3)
}

.product-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--sms-orange-soft);
  display: grid;
  place-items: center;
  color: var(--sms-orange);
  font-size: 20px
}

.product-detail-hero {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--sms-border)
}

.product-detail-image {
  width: 150px;
  height: 150px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--sms-border);
  display: grid;
  place-items: center;
  overflow: hidden
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.product-detail-image i {
  font-size: 42px;
  color: #94a3b8
}

.product-detail-main h4 {
  font-size: 20px;
  letter-spacing: -.02em;
  margin: 0 0 16px
}

.product-meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px
}

.product-meta-grid p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--sms-border);
  border-radius: 12px;
  background: #fbfdff
}

.product-meta-grid span {
  display: block;
  font-size: 11px;
  color: var(--sms-muted);
  margin-bottom: 4px
}

.product-meta-grid b {
  font-size: 13px
}

.detail-section {
  margin-top: 18px
}

.detail-section h6 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #be3f00
}

.detail-table {
  border: 1px solid var(--sms-border);
  border-radius: 14px;
  overflow: hidden
}

.detail-head,
.detail-row {
  display: grid;
  grid-template-columns: 1.5fr .7fr .7fr;
  gap: 12px;
  padding: 11px 14px;
  align-items: center
}

.detail-head {
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  color: #64748b
}

.detail-row {
  border-top: 1px solid #eef2f7;
  font-size: 13px
}

.detail-row span {
  color: #334155
}

.detail-row b {
  font-weight: 600
}

.modal-dialog-scrollable .modal-body {
  max-height: 70vh
}

@media(max-width:1180px) {

  .brand-accordion,
  .brand-grid-head {
    min-width: 1160px
  }

  .brand-action-btn span {
    display: inline !important
  }

  .product-meta-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:760px) {
  .product-detail-hero {
    grid-template-columns: 1fr
  }

  .product-detail-image {
    width: 100%;
    height: 180px
  }

  .product-meta-grid {
    grid-template-columns: 1fr
  }

  .detail-head,
  .detail-row {
    grid-template-columns: 1fr
  }

  .brand-action-btn span {
    display: none !important
  }
}


/* v4 ajustes finales UX */
.user-chip,
.user-chip span,
.user-chip i {
  color: #fff !important
}

.user-menu .dropdown-item {
  font-size: 13px
}

.brand-grid-head {
  grid-template-columns: minmax(230px, 1.05fr) 90px minmax(240px, 1fr) 130px minmax(620px, 1.6fr);
}

.brand-parent-row,
.brand-child-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.05fr) 90px minmax(240px, 1fr) 130px minmax(620px, 1.6fr);
  gap: 16px;
  align-items: center;
  padding: 10px 8px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
  background: #fff
}

.brand-parent-row:first-child {
  border-top: 0
}

.brand-title-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0
}

.brand-toggle {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #334155;
  padding: 0
}

.brand-toggle:hover {
  background: #f1f5f9
}

.brand-toggle[aria-expanded="false"] i {
  transform: rotate(-90deg)
}

.brand-toggle i {
  transition: .18s ease;
  font-size: 13px
}

.brand-child-row {
  background: #fff;
  padding-top: 9px;
  padding-bottom: 9px
}

.brand-child-row>div:last-child,
.brand-parent-row>div:last-child {
  display: flex;
  justify-content: flex-end
}

.brand-empty-row {
  padding: 10px 8px 10px 260px;
  color: var(--sms-muted);
  font-size: 12.5px;
  background: #fbfdff;
  border-top: 1px solid #f1f5f9
}

.brand-action-group {
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: nowrap
}

.brand-action-btn {
  height: 30px;
  white-space: nowrap
}

.product-modal-header {
  background: linear-gradient(180deg, var(--sms-orange), var(--sms-orange-dark)) !important;
  color: #fff;
  border-bottom: 0
}

.product-modal-header p,
.product-modal-header .modal-title {
  color: #fff !important
}

.product-modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: .9
}

.product-modal-icon {
  background: rgba(255, 255, 255, .16) !important;
  color: #fff !important
}

.product-modal-footer {
  background: #fff;
  padding: 14px 22px;
  border-top: 1px solid var(--sms-border)
}

.product-detail-modal .modal-body {
  padding: 22px
}


/* v5 ajustes: accordion cerrado, filas clickeables y modal más compacto */
.brand-parent-row {
  cursor: pointer;
  transition: background .15s ease
}

.brand-parent-row:hover {
  background: #fff8f3
}

.brand-parent-row.collapsed .brand-toggle i {
  transform: rotate(-90deg)
}

.brand-toggle {
  pointer-events: none
}

.child-count {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  margin-left: 4px
}

.product-detail-modal {
  max-width: 920px;
  margin: auto
}

.product-modal-header-compact {
  padding: 14px 20px !important;
  min-height: 58px
}

.product-modal-header-compact .modal-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap
}

.product-modal-header-compact .modal-title {
  font-size: 18px !important;
  line-height: 1 !important;
  white-space: nowrap
}

.product-modal-header-compact .modal-title-line span {
  font-size: 13px;
  color: #fff;
  opacity: .92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.product-modal-header-compact .product-modal-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 17px;
  flex: 0 0 auto
}

.product-detail-modal .modal-body {
  padding: 18px 20px !important
}

.product-detail-hero {
  grid-template-columns: 112px 1fr !important;
  gap: 16px !important;
  padding-bottom: 14px !important
}

.product-detail-image {
  width: 112px !important;
  height: 112px !important;
  border-radius: 16px !important
}

.product-detail-main h4 {
  font-size: 18px !important;
  margin-bottom: 12px !important
}

.product-meta-grid {
  gap: 8px !important
}

.product-meta-grid p {
  padding: 8px 10px !important;
  border-radius: 11px !important
}

.detail-section {
  margin-top: 14px !important
}

.detail-section h6 {
  margin-bottom: 8px !important
}

.detail-head,
.detail-row {
  padding: 9px 12px !important
}

.modal-dialog-scrollable .modal-body {
  max-height: 62vh !important
}

.product-modal-footer {
  padding: 10px 20px !important
}

@media(max-width:760px) {
  .product-detail-hero {
    grid-template-columns: 1fr !important
  }

  .product-detail-image {
    width: 100% !important;
    height: 150px !important
  }

  .product-modal-header-compact .modal-title-line {
    display: block
  }

  .product-modal-header-compact .modal-title-line span {
    display: block;
    margin-top: 4px
  }
}


/* v6 ajustes: marcas sin scroll horizontal, hijos destacados y modal producto lateral */
html,
body {
  max-width: 100%;
  overflow-x: hidden
}

.content {
  overflow-x: hidden
}

.brand-panel {
  overflow: hidden
}

.brand-grid-head,
.brand-parent-row,
.brand-child-row {
  grid-template-columns: minmax(210px, 1.15fr) 70px minmax(180px, 1fr) 88px minmax(500px, 1.75fr) !important;
  gap: 12px !important;
  width: 100% !important;
}

.brand-grid-head,
.brand-accordion {
  min-width: 0 !important;
  width: 100% !important
}

.brand-parent-row {
  min-width: 0 !important
}

.brand-child-row {
  min-width: 0 !important;
  margin: 0 8px 0 28px;
  width: calc(100% - 36px) !important;
  background: linear-gradient(90deg, #fff8f3, #ffffff) !important;
  border-left: 3px solid rgba(255, 91, 0, .35) !important;
  border-radius: 12px;
  border-top: 1px solid #ffe0cc !important;
  box-shadow: inset 0 0 0 1px rgba(255, 91, 0, .04);
}

.brand-child-row:hover {
  background: #fff4ec !important
}

.brand-child-row .brand-child-name {
  padding-left: 6px !important
}

.brand-child-row .tree-line {
  font-weight: 500;
  color: #475569
}

.brand-child-row .tree-line:before {
  border-color: #ffb58a !important
}

.brand-parent-row:not(.collapsed) {
  background: #fff7f0 !important;
  border-radius: 12px;
  box-shadow: inset 3px 0 0 var(--sms-orange)
}

.brand-parent-row:not(.collapsed) .brand-title-cell b {
  color: var(--sms-orange-dark)
}

.brand-parent-row:not(.collapsed) .brand-toggle {
  background: #fff;
  color: var(--sms-orange);
  box-shadow: 0 4px 12px rgba(255, 91, 0, .12)
}

.brand-action-group {
  justify-content: flex-end !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  max-width: 100%
}

.brand-action-btn {
  height: 29px !important;
  padding: 0 7px !important;
  font-size: 11.5px !important;
  border-radius: 10px !important;
  max-width: none
}

.brand-action-btn i {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  font-size: 11px !important
}

.brand-action-btn span {
  line-height: 1;
  white-space: nowrap
}

@media(max-width:1450px) {

  .brand-grid-head,
  .brand-parent-row,
  .brand-child-row {
    grid-template-columns: minmax(190px, 1.1fr) 58px minmax(150px, .95fr) 78px minmax(430px, 1.65fr) !important;
    gap: 9px !important
  }

  .brand-action-btn {
    font-size: 10.8px !important;
    padding: 0 6px !important
  }

  .brand-action-group {
    gap: 5px !important
  }
}

@media(max-width:1250px) {
  .brand-action-btn span {
    display: none !important
  }

  .brand-grid-head,
  .brand-parent-row,
  .brand-child-row {
    grid-template-columns: minmax(210px, 1fr) 60px minmax(180px, 1fr) 90px minmax(180px, .8fr) !important
  }

  .brand-action-btn {
    width: 30px !important;
    padding: 0 !important
  }
}

.product-detail-modal {
  max-width: 980px !important
}

.product-modal-header-compact {
  padding: 10px 18px !important;
  min-height: 50px !important
}

.product-modal-header-compact .modal-title-line {
  gap: 9px !important
}

.product-modal-header-compact .modal-title {
  font-size: 17px !important
}

.product-modal-header-compact .modal-title-line span {
  font-size: 12.5px !important
}

.product-modal-header-compact .product-modal-icon {
  width: 30px !important;
  height: 30px !important;
  border-radius: 10px !important;
  font-size: 15px !important
}

.product-detail-modal .modal-body {
  padding: 16px 18px !important;
  overflow: visible !important;
  max-height: none !important
}

.modal-dialog-scrollable .product-detail-modal .modal-body {
  max-height: none !important;
  overflow: visible !important
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start
}

.product-summary-card {
  background: #fbfdff;
  border: 1px solid var(--sms-border);
  border-radius: 18px;
  padding: 14px;
  position: sticky;
  top: 0
}

.product-summary-card .product-detail-image {
  width: 100% !important;
  height: 155px !important;
  border-radius: 16px !important;
  margin-bottom: 10px
}

.product-channel-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px
}

.product-summary-card h4 {
  font-size: 16px !important;
  line-height: 1.22 !important;
  margin: 0 0 12px !important;
  letter-spacing: -.02em
}

.product-meta-stack {
  display: grid;
  gap: 7px
}

.product-meta-stack p {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--sms-border);
  border-radius: 11px;
  background: #fff
}

.product-meta-stack span {
  display: block;
  font-size: 10.5px;
  color: #64748b;
  margin-bottom: 3px
}

.product-meta-stack b {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a
}

.product-detail-content {
  min-width: 0
}

.product-detail-content .detail-section {
  margin-top: 0 !important;
  margin-bottom: 14px !important
}

.product-detail-content .detail-section:last-child {
  margin-bottom: 0 !important
}

.product-detail-content .detail-section h6 {
  font-size: 13.5px !important;
  margin-bottom: 8px !important
}

.product-detail-content .detail-head,
.product-detail-content .detail-row {
  padding: 9px 12px !important
}

.product-detail-content .detail-table {
  border-radius: 13px !important
}

.product-modal-footer {
  padding: 9px 18px !important
}

.product-modal-footer .btn {
  height: 36px;
  padding: 0 18px;
  border-radius: 10px
}

@media(max-width:900px) {
  .product-detail-layout {
    grid-template-columns: 1fr
  }

  .product-summary-card {
    position: static
  }

  .product-summary-card .product-detail-image {
    height: 180px !important
  }
}


/* v7 ajustes UX: navbar fijo, usuario con ícono, accordion y modal producto refinados */
.app-shell {
  padding-top: 52px
}

.topbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040 !important
}

.sidebar {
  top: 52px !important
}

.user-chip .avatar {
  background: #fff !important;
  color: var(--sms-orange) !important;
  font-size: 13px !important
}

.user-chip .avatar i {
  color: var(--sms-orange) !important
}

.user-chip>span:not(.avatar),
.user-chip>i {
  color: #fff !important
}

.brand-grid-head,
.brand-parent-row,
.brand-child-row {
  grid-template-columns: minmax(230px, 1.45fr) 62px minmax(160px, 1fr) 88px minmax(455px, 1.95fr) !important;
  gap: 10px !important;
}

.brand-parent-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0
}

.brand-parent-row:not(.collapsed) .brand-parent-actions {
  opacity: 0;
  visibility: hidden;
  pointer-events: none
}

.brand-action-group {
  display: flex;
  justify-content: flex-end !important;
  align-items: center;
  gap: 5px !important;
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap !important;
  overflow: visible
}

.brand-action-btn {
  height: 28px !important;
  padding: 0 6px !important;
  font-size: 11px !important;
  border-radius: 9px !important;
  min-width: 0;
  white-space: nowrap
}

.brand-action-btn i {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
  font-size: 10.5px !important
}

.brand-action-btn span {
  display: inline !important;
  white-space: nowrap
}

.brand-child-row {
  background: linear-gradient(90deg, #fff3ea 0%, #fffaf6 55%, #fff 100%) !important;
  border-left: 4px solid rgba(255, 91, 0, .42) !important;
  margin: 0 0 0 18px !important;
  width: calc(100% - 18px) !important;
  border-radius: 10px !important
}

.brand-child-row .brand-child-name {
  padding-left: 8px !important
}

.brand-child-row:hover {
  background: #fff0e5 !important
}

@media(max-width:1500px) {

  .brand-grid-head,
  .brand-parent-row,
  .brand-child-row {
    grid-template-columns: minmax(210px, 1.35fr) 56px minmax(140px, .95fr) 78px minmax(390px, 1.8fr) !important;
    gap: 8px !important
  }

  .brand-action-btn {
    font-size: 10.5px !important;
    padding: 0 5px !important
  }

  .brand-action-btn i {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important
  }
}

@media(max-width:1280px) {
  .brand-action-btn span {
    display: none !important
  }

  .brand-action-btn {
    width: 28px !important;
    padding: 0 !important
  }

  .brand-grid-head,
  .brand-parent-row,
  .brand-child-row {
    grid-template-columns: minmax(200px, 1.3fr) 54px minmax(140px, .95fr) 76px minmax(165px, .85fr) !important
  }
}

.product-detail-modal {
  max-width: 930px !important
}

.product-modal-header-compact {
  padding: 8px 18px !important;
  min-height: 46px !important
}

.product-modal-header-compact .modal-title-line {
  gap: 8px !important
}

.product-modal-header-compact .modal-title {
  font-size: 17px !important;
  line-height: 1 !important
}

.product-modal-header-compact .modal-title-line span {
  font-size: 12.5px !important;
  opacity: .95 !important
}

.product-modal-header-compact .product-modal-icon {
  width: 30px !important;
  height: 30px !important;
  border-radius: 10px !important
}

.product-detail-modal .modal-body {
  padding: 14px 16px !important;
  max-height: none !important;
  overflow: visible !important
}

.product-detail-layout-v7 {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: start
}

.product-summary-card-v7 {
  padding: 12px !important;
  border-radius: 16px !important;
  background: #fbfdff;
  border: 1px solid var(--sms-border);
  position: static !important
}

.product-summary-card-v7 .product-detail-image {
  width: 100% !important;
  height: 138px !important;
  border-radius: 15px !important;
  margin: 0 0 10px !important
}

.product-summary-card-v7 .product-meta-stack {
  gap: 6px !important
}

.product-summary-card-v7 .product-meta-stack p {
  padding: 7px 9px !important;
  border-radius: 10px !important
}

.product-summary-card-v7 .product-meta-stack span {
  font-size: 10px !important;
  margin-bottom: 2px !important
}

.product-summary-card-v7 .product-meta-stack b {
  font-size: 12px !important
}

.product-description-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--sms-border);
  border-radius: 14px;
  background: linear-gradient(90deg, #fff8f3, #fff)
}

.product-description-bar .product-channel-status {
  margin: 0 !important;
  gap: 8px;
  flex: 0 0 auto
}

.product-description-bar h4 {
  margin: 0 !important;
  font-size: 18px !important;
  line-height: 1.18 !important;
  letter-spacing: -.02em;
  min-width: 0
}

.product-detail-content-v7 .detail-section {
  margin-bottom: 12px !important
}

.product-detail-content-v7 .detail-section h6 {
  font-size: 13px !important;
  margin-bottom: 7px !important
}

.product-detail-content-v7 .detail-head,
.product-detail-content-v7 .detail-row {
  padding: 8px 11px !important
}

.product-modal-footer {
  display: flex !important;
  justify-content: flex-end !important;
  padding: 8px 16px !important;
  background: #fff !important;
  border-top: 1px solid var(--sms-border) !important
}

.product-modal-footer .btn {
  height: 34px !important;
  padding: 0 16px !important;
  border-radius: 10px !important
}

@media(max-width:860px) {
  .product-detail-layout-v7 {
    grid-template-columns: 1fr !important
  }

  .product-description-bar {
    align-items: flex-start;
    flex-direction: column
  }

  .product-summary-card-v7 .product-detail-image {
    height: 170px !important
  }
}