:root {
  --ink: #232326;
  --muted: #68666b;
  --line: #e7dfdb;
  --paper: #fffdfb;
  --soft: #f7f1ee;
  --blush: #de0861;
  --blush-dark: #9d0647;
  --sage: #2f786d;
  --sage-soft: #e8f3f0;
  --gold: #c0924f;
  --danger: #b9373e;
  --shadow: 0 14px 34px rgba(35, 35, 38, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-weight: 400;
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(222, 8, 97, 0.08), transparent 36%),
    linear-gradient(210deg, rgba(47, 120, 109, 0.08), transparent 34%),
    #fbf8f5;
}

h1,
h2,
h3,
h4,
strong {
  font-weight: 650;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: end;
  padding: clamp(16px, 4vw, 54px);
  background:
    linear-gradient(90deg, rgba(10, 8, 10, 0.18), rgba(10, 8, 10, 0.08) 42%, rgba(10, 8, 10, 0.56)),
    url("assets/banner-login.png") center / cover no-repeat;
}

.login-card,
.panel,
.metric-card,
.table-shell,
.order-item,
.product-card,
.consultant-card,
.modal {
  border: 1px solid rgba(231, 223, 219, 0.9);
  background: rgba(255, 253, 251, 0.9);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 8px;
  color: #fffdfb;
  background: linear-gradient(135deg, var(--blush), var(--sage));
  font-weight: 650;
  letter-spacing: 0.04em;
}

.eyebrow {
  margin: 0;
  color: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  align-self: center;
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 253, 251, 0.9);
  backdrop-filter: blur(18px);
}

.login-card-inner {
  padding: clamp(24px, 5vw, 38px);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mobile-brand strong,
.mobile-brand span {
  display: block;
}

.mobile-brand span {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-card .eyebrow {
  color: var(--blush);
}

.login-card h1 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 4vw, 2.65rem);
  line-height: 1;
  letter-spacing: 0;
}

.login-copy,
.login-footnote {
  color: var(--muted);
}

.login-copy {
  margin: 0 0 24px;
}

.login-footnote {
  margin: 18px 0 0;
  font-size: 0.84rem;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.compact-form {
  margin-top: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(222, 8, 97, 0.58);
  box-shadow: 0 0 0 4px rgba(222, 8, 97, 0.12);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 650;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--blush), var(--blush-dark));
  box-shadow: 0 12px 26px rgba(222, 8, 97, 0.22);
}

.secondary-btn {
  color: var(--blush-dark);
  background: #fff0f6;
  border: 1px solid rgba(222, 8, 97, 0.18);
}

.ghost-btn {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.danger-btn {
  color: #fff;
  background: var(--danger);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
}

.app-shell {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
} 

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 251, 0.94);
  backdrop-filter: blur(16px);
  z-index: 12;
}

.sidebar-brand {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand span,
.user-card strong,
.user-card span {
  display: block;
}

.sidebar-logo {
  width: min(210px, 100%);
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 0.86rem;
}

.user-card {
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.user-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.nav-menu {
  display: grid;
  gap: 8px;
}

.nav-menu button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 600;
}

.nav-menu button.active,
.nav-menu button:hover {
  color: var(--blush-dark);
  background: #fff0f6;
}

.logout-btn {
  margin-top: auto;
}

.workspace {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 245, 0.88);
  backdrop-filter: blur(16px);
  z-index: 8;
}

.topbar h2 {
  margin: 3px 0 0;
  font-size: clamp(1.3rem, 2vw, 2rem);
  letter-spacing: 0;
}

.topbar .eyebrow {
  color: var(--blush);
}

.icon-btn,
.icon-close,
.table-action {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.icon-btn {
  display: none;
  gap: 4px;
}

.icon-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.content {
  min-width: 0;
  padding: 28px;
}

.view {
  display: none;
  min-width: 0;
}

.active-view {
  display: block;
}

.view-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.view-head h3,
.panel h3,
.modal h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.view-head p,
.panel-copy {
  margin: 6px 0 0;
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  border-radius: 8px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--sage);
  font-weight: 600;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.panel-grid > *,
.metrics-grid > *,
.catalog-grid > *,
.consultants-grid > * {
  min-width: 0;
}

.panel {
  min-width: 0;
  border-radius: 8px;
  padding: 20px;
}

.section-toolbar,
.filters-row,
.form-row,
.product-picker-tools,
.line-item {
  display: grid;
  gap: 12px;
}

.section-toolbar {
  grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
  margin-bottom: 14px;
}

.filters-row {
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  margin: 14px 0;
}

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

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

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.form-section h4 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.product-section-head {
  align-items: start;
  gap: 16px;
}

.product-section-head h4 {
  margin-bottom: 4px;
}

.product-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.product-picker-tools {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  margin-bottom: 14px;
}

.product-picker-note {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 170px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--rose-soft);
}

.product-picker-note strong {
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
}

.product-picker-note span {
  color: var(--muted);
  font-size: 0.84rem;
}

.line-items {
  display: grid;
  gap: 12px;
}

.line-item {
  grid-template-columns: minmax(260px, 1fr) 96px 132px 132px 44px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.line-product-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.line-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.line-product-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}

.line-product-meta.missing-price span:first-child::after {
  content: " · sin precio";
  color: var(--danger);
  font-weight: 700;
}

.line-price[readonly],
.line-subtotal[readonly] {
  color: var(--ink);
  background: #fff;
  font-weight: 700;
}

.remove-line {
  width: 44px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--danger);
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.order-summary {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 8px;
  background: var(--sage-soft);
}

.order-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
}

.order-summary .grand-total {
  padding-top: 10px;
  border-top: 1px solid rgba(47, 120, 109, 0.22);
  font-size: 1.18rem;
}

.file-drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px dashed rgba(222, 8, 97, 0.4);
  border-radius: 8px;
  background: #fff8fa;
  text-align: center;
  padding: 18px;
}

.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop strong,
.file-drop span {
  display: block;
}

.file-drop span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.notify-section {
  background: linear-gradient(180deg, #fff, var(--soft));
}

.check-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.check-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blush);
  flex: 0 0 auto;
}

.check-option input:disabled {
  cursor: not-allowed;
}

.check-option span {
  display: grid;
  gap: 4px;
}

.check-option small {
  color: var(--muted);
  line-height: 1.45;
}

.receipt-preview {
  display: none;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.receipt-preview.active {
  display: block;
}

.receipt-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #f4f4f4;
}

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

.table-shell {
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--soft);
}

td strong,
td span {
  display: block;
}

td span {
  color: var(--muted);
  font-size: 0.88rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.status-pending {
  color: #8b5a12;
  background: #fff2d9;
}

.status-paid,
.status-confirmed {
  color: #1f685e;
  background: var(--sage-soft);
}

.status-shipped {
  color: #315f96;
  background: #e7f0fb;
}

.status-cancelled {
  color: #9f2d35;
  background: #ffe5e7;
}

.order-list {
  display: grid;
  gap: 12px;
}

.order-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  border-radius: 8px;
  padding: 16px;
}

.order-item h4,
.product-card h4,
.consultant-card h4 {
  margin: 0;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.order-meta span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 550;
}

.chart-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.chart-row {
  display: grid;
  gap: 8px;
}

.chart-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  color: inherit;
  background: #fff;
  text-align: left;
}

.chart-button:hover,
.chart-button.selected {
  border-color: rgba(222, 8, 97, 0.22);
  background: #fff8fa;
}

.chart-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0e7e2;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blush), var(--sage));
}

.chart-subtext {
  color: var(--muted);
  font-size: 0.84rem;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
}

.reports-page {
  display: grid;
  gap: 18px;
}

.report-metrics {
  margin-bottom: 0;
}

.report-metrics .metric-card {
  padding: 16px;
  box-shadow: none;
}

.report-section {
  min-width: 0;
  border: 1px solid rgba(231, 223, 219, 0.9);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255, 253, 251, 0.92);
  box-shadow: var(--shadow);
}

.report-section-head,
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.report-section-head.with-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
}

.report-section-head span,
.section-kicker {
  display: block;
  margin: 0 0 6px;
  color: var(--blush);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.report-section-head h3,
.report-block h4,
.section-title-row h3 {
  margin: 0;
  letter-spacing: 0;
}

.report-section-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.report-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.report-block {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-block .table-shell {
  box-shadow: none;
}

.report-block h4 {
  font-size: 1rem;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.access-panel {
  position: sticky;
  top: 104px;
}

.hierarchy-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.hierarchy-summary article {
  border: 1px solid rgba(231, 223, 219, 0.9);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 253, 251, 0.92);
  box-shadow: var(--shadow);
}

.hierarchy-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hierarchy-summary strong {
  display: block;
  margin-top: 10px;
  font-size: 1.8rem;
  line-height: 1;
}

.hierarchy-summary small {
  display: block;
  margin-top: 7px;
  color: var(--sage);
  font-weight: 600;
}

.hierarchy-panel {
  padding: 22px;
}

.hierarchy-board {
  display: grid;
  gap: 16px;
}

.hierarchy-level {
  display: grid;
  gap: 12px;
}

.level-label {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--blush-dark);
  background: #fff0f6;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hierarchy-line {
  width: 1px;
  height: 24px;
  margin-left: 24px;
  background: var(--line);
}

.hierarchy-person,
.member-row,
.team-unassigned-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.hierarchy-person.management-node {
  border-color: rgba(222, 8, 97, 0.28);
  background: #fff8fa;
}

.hierarchy-person.supervisor-node {
  border-color: rgba(47, 120, 109, 0.22);
}

.hierarchy-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blush), var(--sage));
  font-weight: 700;
}

.hierarchy-person-main strong,
.hierarchy-person-main span,
.hierarchy-person-main small,
.member-row strong,
.member-row span,
.member-row small,
.team-unassigned-head strong,
.team-unassigned-head span {
  display: block;
}

.hierarchy-person-main span,
.member-row span,
.team-unassigned-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.hierarchy-person-main small,
.member-row small {
  margin-top: 3px;
  color: var(--sage);
  font-size: 0.82rem;
  font-weight: 600;
}

.team-grid {
  display: grid;
  gap: 14px;
}

.team-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.team-block.unassigned-team {
  background: #fff8fa;
}

.team-members {
  display: grid;
  gap: 8px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.team-members-standalone {
  padding-left: 0;
  border-left: 0;
}

.members-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.member-row {
  grid-template-columns: minmax(0, 1fr) auto;
  box-shadow: none;
}

.member-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.report-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 14px;
  align-items: start;
}

.consultant-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.consultant-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.detail-stats div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-stats span,
.row-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.detail-stats strong,
.row-metrics strong {
  display: block;
  margin-top: 5px;
}

.consultant-detail-list,
.consultant-list,
.catalog-list {
  display: grid;
  gap: 10px;
}

.list-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: #fff;
  text-align: left;
}

.list-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.order-detail-row:hover {
  border-color: rgba(222, 8, 97, 0.26);
  background: #fff8fa;
}

.row-metrics,
.product-row-meta {
  text-align: right;
  white-space: nowrap;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px 180px;
  gap: 12px;
  margin-bottom: 14px;
}

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

.product-card,
.consultant-card {
  border-radius: 8px;
  padding: 16px;
}

.product-card {
  display: grid;
  gap: 12px;
}

.product-thumb {
  min-height: 120px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(135deg, rgba(222, 8, 97, 0.22), rgba(47, 120, 109, 0.2)),
    var(--soft);
  border: 1px solid var(--line);
}

.product-card p,
.consultant-card p {
  margin: 0;
  color: var(--muted);
}

.product-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 650;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  text-align: center;
  font-weight: 600;
}

.modal {
  width: min(860px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border-radius: 8px;
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(35, 35, 38, 0.48);
}

.password-modal {
  width: min(460px, calc(100vw - 28px));
}

.password-modal .primary-btn {
  width: 100%;
}

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

.modal-head .eyebrow {
  color: var(--blush);
}

.modal-body {
  padding: 18px;
  overflow: auto;
}

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

.detail-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-box span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-box strong {
  display: block;
  margin-top: 6px;
}

.receipt-full {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.receipt-full img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #f2f2f2;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin: 16px 0 0;
}

.sales-ticket {
  margin-top: 18px;
  padding: 18px;
  border: 2px solid #a4a4a4;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
}

.ticket-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
  align-items: start;
}

.ticket-logo {
  width: 112px;
  height: 80px;
  display: grid;
  place-items: center;
  color: #8d8d8d;
  font-family: Georgia, serif;
  font-size: 2rem;
  border-left: 8px solid #eb4f91;
  border-radius: 50%;
}

.ticket-trade {
  margin-top: 4px;
  color: #eb4f91;
  font-size: 1.25rem;
  font-weight: 600;
}

.ticket-brand h4 {
  margin: 14px 0 2px;
  font-size: 1rem;
}

.ticket-brand p {
  margin: 0;
  font-size: 0.78rem;
}

.ticket-number {
  overflow: hidden;
  border: 3px solid #9e9e9e;
  border-radius: 8px;
  text-align: center;
}

.ticket-number strong,
.ticket-number span {
  display: block;
  padding: 12px;
  font-size: 1.05rem;
}

.ticket-number span {
  background: #cfcfcf;
  font-weight: 700;
}

.ticket-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.ticket-box,
.ticket-observations {
  min-height: 92px;
  padding: 10px;
  border: 3px solid #a4a4a4;
  border-radius: 8px;
}

.ticket-box p {
  margin: 0 0 4px;
  font-size: 0.78rem;
}

.ticket-table {
  min-width: 0;
  margin-top: 6px;
  border: 3px solid #a4a4a4;
  font-size: 0.74rem;
}

.ticket-table th,
.ticket-table td {
  padding: 4px 6px;
  border: 2px solid #a4a4a4;
}

.ticket-table th {
  color: #111;
  background: #d4d4d4;
}

.ticket-table tbody {
  min-height: 260px;
}

.ticket-words {
  margin-top: 6px;
  padding: 6px;
  border: 3px solid #a4a4a4;
  border-radius: 8px;
  font-size: 1rem;
  font-style: italic;
  font-weight: 700;
  text-align: right;
}

.ticket-observations {
  min-height: 34px;
  margin-top: 6px;
  font-size: 0.78rem;
}

.ticket-bottom {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 16px;
  align-items: end;
  margin-top: 4px;
}

.ticket-bottom small {
  font-weight: 700;
}

.ticket-totals {
  display: grid;
  gap: 4px;
}

.ticket-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 3px solid #a4a4a4;
  border-radius: 8px;
}

.ticket-total {
  background: #d4d4d4;
  font-size: 1.25rem;
}

.print-body {
  margin: 0;
  background: #fff;
}

.print-body .sales-ticket {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .auth-screen {
    grid-template-columns: 1fr;
    justify-items: center;
    background-position: center;
  }

  .login-card {
    align-self: center;
  }

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

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

  .report-layout {
    grid-template-columns: 1fr;
  }

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

  .access-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 86vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .icon-btn {
    display: inline-grid;
  }

  .topbar {
    padding: 14px 16px;
  }

  .topbar-actions {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .metrics-grid,
  .hierarchy-summary,
  .catalog-grid,
  .consultants-grid,
  .form-row,
  .section-toolbar,
  .filters-row,
  .product-picker-tools,
  .catalog-toolbar,
  .report-title-row,
  .report-section-head.with-control,
  .detail-stats,
  .ticket-top,
  .ticket-info-grid,
  .ticket-bottom,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .line-item {
    grid-template-columns: 1fr 90px;
  }

  .line-product-block,
  .line-subtotal-field {
    grid-column: 1 / -1;
  }

  .product-picker-note {
    justify-items: start;
    min-width: 0;
  }

  .remove-line {
    width: 100%;
  }
}

@media print {
  body:not(.print-body) > *:not(.modal) {
    display: none !important;
  }

  .modal {
    width: 100%;
    max-height: none;
    border: 0;
    box-shadow: none;
  }

  .modal-head,
  .modal-body > *:not(.sales-ticket) {
    display: none !important;
  }

  .sales-ticket {
    margin: 0;
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 620px) {
  .auth-screen {
    min-height: 100svh;
    padding: 14px;
    align-items: end;
    background-position: 46% center;
  }

  .login-card {
    width: 100%;
  }

  .login-card-inner {
    padding: 22px;
  }

  .login-card h1 {
    font-size: 2rem;
  }

  .view-head,
  .form-actions,
  .order-item,
  .list-row,
  .consultant-detail-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .row-metrics,
  .product-row-meta {
    text-align: left;
    white-space: normal;
  }

  .hierarchy-person,
  .member-row,
  .team-unassigned-head,
  .section-title-row,
  .report-section-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .team-members {
    padding-left: 0;
    border-left: 0;
  }

  .report-section,
  .hierarchy-panel {
    padding: 16px;
  }

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

  .metric-card {
    padding: 16px;
  }

  .table-shell {
    box-shadow: none;
  }

  .table-shell table {
    min-width: 680px;
  }
}

/* Glow Club visual refresh 2026-07-09 */
:root {
  --ink: #1f2028;
  --muted: #6d6875;
  --line: #eee3e8;
  --paper: #ffffff;
  --soft: #fff6fa;
  --surface: rgba(255, 255, 255, 0.92);
  --blush: #de0861;
  --blush-dark: #b9054e;
  --blush-soft: #fff0f6;
  --violet: #a746ff;
  --violet-soft: #f7eaff;
  --orange: #ff8a1d;
  --orange-soft: #fff2e4;
  --sage: #047a6d;
  --sage-soft: #e7f5f1;
  --shadow: 0 18px 44px rgba(31, 32, 40, 0.06);
  --shadow-strong: 0 20px 42px rgba(222, 8, 97, 0.2);
  --radius: 8px;
  --sidebar-width: 256px;
  --header-height: 92px;
  --focus: 0 0 0 4px rgba(222, 8, 97, 0.14);
}

html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 96% 0%, rgba(222, 8, 97, 0.06), transparent 32%),
    linear-gradient(180deg, #fffbfe 0%, #fff 38%, #fffafc 100%);
  font-size: 15px;
}

h1,
h2,
h3,
h4,
strong {
  font-weight: 680;
}

.ui-icon {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  gap: 24px;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 12px 0 34px rgba(31, 32, 40, 0.035);
}

.sidebar-brand {
  justify-items: center;
  gap: 4px;
  padding: 0 8px 22px;
  border-bottom: 0;
}

.sidebar-logo {
  width: min(198px, 100%);
  max-height: 68px;
  object-position: center;
}

.sidebar-brand span {
  display: none;
}

.user-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 32, 40, 0.035);
}

.user-avatar,
.hierarchy-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blush), #535c64);
  font-weight: 750;
}

.user-card strong,
.user-card span {
  overflow-wrap: anywhere;
}

.user-card strong {
  font-size: 0.9rem;
}

.user-card span {
  margin-top: 2px;
  font-size: 0.78rem;
}

.user-card-caret {
  color: var(--ink);
  font-size: 1.05rem;
}

.nav-menu {
  gap: 10px;
}

.nav-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border-radius: 8px;
  padding: 11px 14px;
  color: #4f4b58;
  font-weight: 640;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-menu button.active {
  position: relative;
  color: var(--blush);
  background: linear-gradient(90deg, rgba(222, 8, 97, 0.12), rgba(222, 8, 97, 0.04));
}

.nav-menu button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: var(--blush);
}

.nav-menu button:hover {
  color: var(--blush);
  background: var(--blush-soft);
  transform: translateX(2px);
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.workspace {
  background: transparent;
}

.topbar {
  min-height: var(--header-height);
  padding: 26px clamp(18px, 3vw, 46px) 14px;
  border-bottom: 0;
  background: rgba(255, 251, 254, 0.86);
}

.topbar h2 {
  font-size: clamp(1.6rem, 2.2vw, 2.25rem);
  line-height: 1.05;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.content {
  padding: 14px clamp(18px, 3vw, 46px) 34px;
}

.view {
  max-width: 1520px;
}

.page-hero {
  align-items: end;
  margin-bottom: 22px;
}

.page-hero h3,
.view-head h3 {
  font-size: clamp(1.8rem, 2.8vw, 2.45rem);
  line-height: 1.05;
}

.section-kicker,
.eyebrow {
  color: var(--blush);
  letter-spacing: 0.14em;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.quick-filter,
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border-radius: 8px;
}

.primary-btn {
  background: linear-gradient(135deg, #f0046b, var(--blush-dark));
  box-shadow: var(--shadow-strong);
}

.secondary-btn {
  color: var(--blush);
  background: var(--blush-soft);
}

.ghost-btn {
  color: #37333d;
  background: #fff;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

input,
select,
textarea {
  min-height: 48px;
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
}

.password-field,
.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 84px;
}

.password-toggle {
  position: absolute;
  right: 7px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--blush);
  background: var(--blush-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.search-field .ui-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
}

.search-field input {
  padding-left: 44px;
}

.filters-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}

.dashboard-filters {
  grid-template-columns: minmax(260px, 1.2fr) minmax(210px, 1fr) minmax(210px, 1fr);
}

.filter-control {
  min-width: 0;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(31, 32, 40, 0.035);
}

.filter-control span {
  color: #4a4651;
  font-weight: 650;
  white-space: nowrap;
}

.filter-control strong {
  min-width: 0;
  color: var(--muted);
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card,
.hierarchy-summary article,
.panel,
.report-section,
.catalog-control-panel,
.catalog-table-card,
.form-section,
.table-shell,
.order-item,
.list-row {
  border: 1px solid rgba(238, 227, 232, 0.96);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metrics-grid,
.hierarchy-summary {
  gap: 18px;
}

.metric-card,
.hierarchy-summary article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 126px;
  padding: 20px 22px;
  position: relative;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: var(--blush);
  background: var(--blush-soft);
}

.metric-icon .ui-icon {
  width: 1.55rem;
  height: 1.55rem;
}

.metric-copy span,
.hierarchy-summary span {
  color: #625d68;
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.metric-copy strong,
.hierarchy-summary strong {
  margin-top: 8px;
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  line-height: 1;
}

.metric-copy small,
.hierarchy-summary small {
  color: var(--blush);
}

.metric-sparkline {
  display: none;
  width: 66px;
  height: 32px;
  align-self: end;
  background:
    linear-gradient(135deg, transparent 10%, transparent 28%, currentColor 29%, currentColor 34%, transparent 35%),
    linear-gradient(45deg, transparent 22%, transparent 44%, currentColor 45%, currentColor 50%, transparent 51%);
  color: var(--blush);
  opacity: 0.9;
  clip-path: polygon(0 72%, 15% 48%, 28% 66%, 42% 24%, 55% 52%, 70% 44%, 86% 22%, 100% 40%, 100% 100%, 0 100%);
}

.metric-copy {
  min-width: 0;
}

.metric-copy span,
.metric-copy small {
  display: block;
  overflow-wrap: anywhere;
}

@media (min-width: 1440px) {
  .metric-card {
    padding-right: 88px;
  }

  .metric-sparkline {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: block;
  }
}

.metric-violet .metric-icon,
.metric-violet.metric-card .metric-icon {
  color: var(--violet);
  background: var(--violet-soft);
}

.metric-orange .metric-icon,
.metric-orange.metric-card .metric-icon {
  color: var(--orange);
  background: var(--orange-soft);
}

.metric-green .metric-icon,
.metric-green.metric-card .metric-icon {
  color: var(--sage);
  background: var(--sage-soft);
}

.metric-violet .metric-copy small,
.metric-violet small {
  color: var(--violet);
}

.metric-orange .metric-copy small,
.metric-orange small {
  color: var(--orange);
}

.metric-green .metric-copy small,
.metric-green small {
  color: var(--sage);
}

.panel {
  padding: 24px;
}

.panel-grid {
  gap: 22px;
}

.dashboard-bottom-grid {
  margin-top: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.section-title-row {
  align-items: center;
}

.mini-action {
  min-height: 38px;
  padding-inline: 14px;
  color: var(--blush);
  border-color: rgba(222, 8, 97, 0.22);
}

.order-list,
.consultant-detail-list,
.chart-list {
  gap: 12px;
}

.order-item,
.list-row,
.chart-button {
  border-color: var(--line);
}

.bar-track {
  height: 10px;
  background: #f8e9ef;
}

.bar-fill {
  background: linear-gradient(90deg, #e60267, #c7055a);
}

.payment-summary-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.donut {
  --value: 0;
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background: conic-gradient(var(--blush) calc(var(--value) * 1%), #ffb6a8 0);
  position: relative;
}

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

.donut strong,
.donut span {
  position: relative;
  z-index: 1;
}

.donut span {
  margin-top: 26px;
  color: var(--muted);
  font-size: 0.76rem;
}

.payment-mini-grid,
.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.payment-mini-grid div,
.detail-stats div {
  min-width: 0;
  border-radius: 8px;
  background: #fff;
}

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

.goal-line {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.goal-line div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.catalog-control-panel {
  padding: 18px;
  margin-bottom: 22px;
}

.catalog-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(210px, 0.32fr) minmax(210px, 0.32fr);
  margin-bottom: 14px;
}

.quick-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-filter {
  border: 1px solid rgba(222, 8, 97, 0.16);
  padding: 0 16px;
  color: var(--blush);
  background: #fff;
  font-weight: 720;
}

.quick-filter.active,
.quick-filter:hover {
  background: var(--blush-soft);
}

.catalog-table-card {
  overflow: hidden;
}

.catalog-table-head,
.catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 150px;
  gap: 18px;
  align-items: center;
}

.catalog-table-head {
  padding: 14px 22px;
  color: #615c66;
  background: #fff7fb;
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-list {
  gap: 0;
}

.catalog-row {
  min-width: 0;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.product-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.product-main strong,
.product-main span {
  display: block;
  overflow-wrap: anywhere;
}

.product-main span {
  margin-top: 5px;
  color: var(--muted);
}

.product-miniature {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blush);
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(135deg, #fff1f7, #ffe7ef);
  font-weight: 780;
}

.add-product-btn {
  width: 100%;
}

.pagination-row,
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-row {
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.page-btn {
  min-width: 38px;
  min-height: 38px;
  padding: 0 12px;
}

.page-btn.active {
  color: #fff;
  border-color: transparent;
  background: var(--blush);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination-ellipsis {
  color: var(--muted);
}

.users-layout {
  gap: 24px;
}

.access-panel {
  top: 118px;
}

.hierarchy-summary article {
  min-height: 126px;
}

.hierarchy-person,
.member-row,
.team-unassigned-head {
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 32, 40, 0.035);
}

.team-block {
  border-color: var(--line);
  background: #fff;
}

.team-members {
  margin-left: 24px;
  padding-left: 18px;
}

.modal {
  border-radius: 8px;
}

.toast {
  border-radius: 8px;
  background: #222029;
}

.sidebar-overlay {
  display: none;
}

.menu-open {
  overflow: hidden;
}

@media (min-width: 861px) {
  .topbar {
    display: none;
  }

  .content {
    padding-top: 32px;
  }
}

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

  .filters-strip,
  .dashboard-filters,
  .report-filters,
  .team-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-toolbar .search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1024px) {
  .panel-grid,
  .dashboard-bottom-grid,
  .report-focus-grid,
  .users-layout {
    grid-template-columns: 1fr;
  }

  .access-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: min(300px, 86vw);
    transform: translateX(-110%);
    box-shadow: 20px 0 44px rgba(31, 32, 40, 0.14);
    z-index: 40;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    display: block;
    z-index: 35;
    background: rgba(31, 32, 40, 0.34);
    backdrop-filter: blur(2px);
  }

  .sidebar-overlay[hidden] {
    display: none;
  }

  .icon-btn {
    display: inline-grid;
  }

  .topbar {
    min-height: 74px;
    padding: 14px 16px;
  }

  .topbar-actions {
    display: flex;
  }

  .content {
    padding: 14px 16px 28px;
  }

  .page-hero {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .page-hero .primary-btn,
  .topbar-actions .secondary-btn {
    width: 100%;
  }

  .catalog-table-head {
    display: none;
  }

  .catalog-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .product-row-meta,
  .catalog-row-action {
    text-align: left;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .auth-screen {
    padding: 14px;
    align-items: end;
  }

  .login-card-inner {
    padding: 22px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar h2 {
    font-size: 1.25rem;
  }

  .topbar-actions {
    display: none;
  }

  .page-hero h3,
  .view-head h3 {
    font-size: 1.72rem;
  }

  .filters-strip,
  .dashboard-filters,
  .report-filters,
  .team-filters,
  .metrics-grid,
  .hierarchy-summary,
  .catalog-toolbar,
  .product-picker-tools,
  .form-row,
  .detail-stats,
  .payment-mini-grid,
  .payment-summary-layout,
  .ticket-top,
  .ticket-info-grid,
  .ticket-bottom,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .hierarchy-summary article {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: auto;
    padding: 16px;
  }

  .metric-sparkline {
    display: none;
  }

  .panel,
  .report-section,
  .catalog-control-panel,
  .form-section {
    padding: 16px;
  }

  .section-title-row,
  .report-section-head,
  .consultant-detail-head,
  .form-actions,
  .order-item,
  .list-row,
  .hierarchy-person,
  .member-row,
  .team-unassigned-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .team-members {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .line-item {
    grid-template-columns: 1fr;
  }

  .product-picker-note {
    justify-items: start;
    min-width: 0;
  }

  .remove-line {
    width: 100%;
  }

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

  .table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .table-shell table:not(.ticket-table) {
    min-width: 0;
    display: block;
    background: transparent;
  }

  .table-shell table:not(.ticket-table) thead {
    display: none;
  }

  .table-shell table:not(.ticket-table) tbody,
  .table-shell table:not(.ticket-table) tr,
  .table-shell table:not(.ticket-table) td {
    display: block;
    width: 100%;
  }

  .table-shell table:not(.ticket-table) tr {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .table-shell table:not(.ticket-table) td {
    display: grid;
    grid-template-columns: minmax(92px, 0.38fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border: 0;
  }

  .table-shell table:not(.ticket-table) td + td {
    border-top: 1px solid #f2e8ed;
  }

  .table-shell table:not(.ticket-table) td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 760;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .table-action {
    width: 100%;
  }

  .pagination-row,
  .pagination-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pagination-actions {
    grid-template-columns: repeat(4, minmax(0, auto));
    justify-content: start;
  }

  #catalog-page-size {
    grid-column: 1 / -1;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 20px);
  }
}

@media (max-width: 430px) {
  .content {
    padding-inline: 12px;
  }

  .filter-control {
    align-items: flex-start;
  }

  .filter-control strong {
    white-space: normal;
  }

  .product-main {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .product-miniature {
    width: 48px;
    height: 48px;
  }

  .payment-summary-layout {
    gap: 12px;
  }
}

@media (max-width: 360px) {
  .content {
    padding-inline: 10px;
  }

  .page-hero h3,
  .view-head h3 {
    font-size: 1.48rem;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .danger-btn {
    padding-inline: 12px;
  }

  .metric-icon {
    width: 48px;
    height: 48px;
  }
}
.product-picker-tools-add {
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
}

.add-selected-product {
  min-height: 44px;
  white-space: nowrap;
}

.product-helper {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-products {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--paper);
}

.empty-lines-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.selected-product-card {
  display: grid;
  gap: 6px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.selected-product-card strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.selected-product-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 760px) {
  .product-picker-tools-add {
    grid-template-columns: 1fr;
  }

  .add-selected-product {
    width: 100%;
  }
}
.workspace::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 10px;
}

.workspace::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
  background: #f7f1ee;
}

.workspace::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(222, 8, 97, 0.28);
  border-radius: 999px;
  border: 2px solid #f7f1ee;
}

.workspace::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(222, 8, 97, 0.45);
}
/* Scroll independiente en escritorio */
@media (min-width: 861px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
  }

  .workspace {
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* Ajuste para celular */
@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
    height: auto;
    overflow: visible;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    transform: translateX(-110%);
    z-index: 40;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
  }
}

/* Scrollbar bonito solo donde aplica */
.workspace::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 10px;
}

.workspace::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
  background: #f7f1ee;
}

.workspace::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(222, 8, 97, 0.28);
  border-radius: 999px;
  border: 2px solid #f7f1ee;
}

.workspace::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(222, 8, 97, 0.45);
}
/* Inventario y precios - acceso exclusivo de gerencia */
.inventory-control-panel,
.inventory-table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.94);
  box-shadow: var(--shadow);
}

.inventory-control-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 220px 190px;
  gap: 12px;
  align-items: center;
}

.inventory-note,
.inventory-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

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

.inventory-table-scroll {
  overflow-x: auto;
}

.inventory-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

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

.inventory-table th {
  color: var(--muted);
  background: var(--soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.inventory-table tbody tr:hover {
  background: rgba(222, 8, 97, 0.025);
}

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

.inventory-product-cell .product-miniature {
  flex: 0 0 auto;
}

.inventory-product-cell strong,
.inventory-product-cell span,
.inventory-subcategory {
  display: block;
}

.inventory-product-cell strong {
  line-height: 1.35;
}

.inventory-product-cell span,
.inventory-subcategory {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.inventory-value {
  white-space: nowrap;
  font-size: 1rem;
}

.inventory-value-warning {
  color: var(--danger);
}

.inventory-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.inventory-state-ok {
  color: #246a5f;
  background: #e8f3f0;
}

.inventory-state-low {
  color: #8b5d11;
  background: #fff4d9;
}

.inventory-state-out,
.inventory-state-price {
  color: #9b2630;
  background: #fdebed;
}

.inventory-edit-btn {
  min-height: 38px;
  padding: 8px 14px;
}

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

.inventory-current-grid > div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.inventory-current-grid span,
.inventory-current-grid strong {
  display: block;
}

.inventory-current-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.inventory-current-grid strong {
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-modal {
  width: min(640px, calc(100vw - 28px));
}

.money-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.money-input:focus-within {
  border-color: rgba(222, 8, 97, 0.58);
  box-shadow: 0 0 0 4px rgba(222, 8, 97, 0.12);
}

.money-input > span {
  padding-left: 12px;
  color: var(--muted);
  font-weight: 700;
}

.money-input input {
  min-height: 42px;
  border: 0;
  box-shadow: none;
}

.money-input input:focus {
  border: 0;
  box-shadow: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.catalog-row-action {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.product-row-meta > span:not(.status-pill) {
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 1000px) {
  .inventory-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .inventory-toolbar .search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .inventory-toolbar,
  .inventory-current-grid {
    grid-template-columns: 1fr;
  }

  .inventory-toolbar .search-field {
    grid-column: auto;
  }

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

  .inventory-table thead {
    display: none;
  }

  .inventory-table,
  .inventory-table tbody,
  .inventory-table tr,
  .inventory-table td {
    display: block;
    width: 100%;
  }

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

  .inventory-table td {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border: 0;
  }

  .inventory-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .inventory-product-cell {
    min-width: 0;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }
}


/* Altas y bajas de productos y accesos */
.danger-outline-btn {
  min-height: 38px;
  border: 1px solid rgba(185, 55, 62, 0.28);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--danger);
  background: #fff7f7;
  font-weight: 650;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.danger-outline-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(185, 55, 62, 0.52);
  background: #fdebed;
}

.inventory-row-actions,
.user-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-card-actions {
  min-width: 150px;
}

.compact-danger-btn {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.78rem;
  white-space: nowrap;
}

#product-dialog .modal-body {
  max-height: min(72vh, 720px);
  overflow-y: auto;
}

@media (max-width: 680px) {
  .inventory-row-actions,
  .user-card-actions {
    justify-content: stretch;
  }

  .inventory-row-actions button,
  .user-card-actions button {
    flex: 1 1 auto;
  }

  .hierarchy-person,
  .member-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .hierarchy-person .user-card-actions,
  .member-row .user-card-actions {
    grid-column: 1 / -1;
    width: 100%;
  }
}
