:root {
  --primary-rgb: 246, 109, 58;
}

.authentication-brand {
  height: 2.75rem !important;
  width: auto !important;
  max-width: 15.5rem;
  object-fit: contain;
}

.app-sidebar .main-sidebar-header .header-logo img,
.app-header .header-logo img {
  height: 2rem !important;
  width: auto !important;
  max-width: 11.5rem;
  object-fit: contain;
}

.app-sidebar .main-sidebar-header .header-logo .toggle-logo,
.app-sidebar .main-sidebar-header .header-logo .toggle-dark,
.app-sidebar .main-sidebar-header .header-logo .toggle-white,
.app-header .header-logo .toggle-logo,
.app-header .header-logo .toggle-dark,
.app-header .header-logo .toggle-white {
  max-width: 2.75rem;
}

.header-nav {
  display: none;
}

.header-nav .header-link {
  gap: 0.4rem;
}

.header-nav .header-link.active,
.header-nav .header-link.active .header-link-icon {
  color: #ffffff;
}

body.factun-app,
html:has(body.factun-app) {
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
}

body.factun-app {
  min-height: 0 !important;
}

body.factun-app .page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
  min-height: 0 !important;
  overflow: hidden;
}

body.factun-app .app-header {
  position: relative !important;
  inset: auto !important;
  flex: 0 0 auto;
  width: 100% !important;
  padding-inline-start: 0 !important;
  z-index: 20;
}

body.factun-app .factun-header {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  min-height: 3.75rem;
  height: 100%;
  padding: 0 4% !important;
}

body.factun-app .factun-header-col {
  display: flex;
  align-items: center;
  min-width: 0;
}

body.factun-app .factun-header-logo {
  flex: 0 0 30%;
  width: 30%;
  max-width: 30%;
  justify-content: flex-start;
}

body.factun-app .factun-header-menu {
  flex: 0 0 40%;
  width: 40%;
  max-width: 40%;
  justify-content: center;
  align-items: stretch;
  align-self: stretch;
}

body.factun-app .factun-header-user {
  flex: 0 0 30%;
  width: 30%;
  max-width: 30%;
  justify-content: flex-end;
}

body.factun-app .factun-header-menu .header-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  align-self: stretch;
  width: auto;
  height: 100%;
  margin: 0;
  gap: 0.35rem;
}

body.factun-app .factun-header-menu .header-element {
  display: flex;
  align-items: stretch;
  height: 100%;
}

body.factun-app .factun-header-menu .header-link {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.15rem;
  height: 100%;
  padding-block: 0;
  padding-inline: 0.85rem;
  text-align: center;
  box-sizing: border-box;
}

body.factun-app .factun-header-menu .header-link.active,
body.factun-app .factun-header-menu .header-link.active:hover,
body.factun-app .factun-header-menu .header-link.active.show {
  color: #ffffff;
  background: #12126b;
  border-bottom: 4px solid #f66d3a;
}

body.factun-app .factun-header-menu .header-link.active .header-link-icon,
body.factun-app .factun-header-menu .header-link.active:hover .header-link-icon,
body.factun-app .factun-header-menu .header-link.active span,
body.factun-app .factun-header-menu .header-link.active:hover span {
  color: #ffffff;
  fill: #ffffff;
  background: transparent;
}

body.factun-app .factun-header-menu .header-link-icon {
  width: auto;
  height: auto;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
}

body.factun-app .factun-header-menu .header-link span {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  display: block !important;
}

body.factun-app .footer {
  flex: 0 0 auto;
  z-index: 10;
  padding-inline-start: 0 !important;
  box-shadow: 0 .25rem 1rem var(--black-1), 0 -0.25rem 1rem var(--black-1);
  background: #ffffff;
}

body.factun-app .footer a {
  color: #12126b;
  font-weight: 600;
  text-decoration: none;
}

body.factun-app .footer a:hover {
  text-decoration: underline;
}

body.factun-app .app-content {
  flex: 1 1 auto;
  min-height: 0 !important;
  margin-block-start: 0 !important;
  margin-inline-start: 0 !important;
  overflow-x: hidden;
  overflow-y: auto;
}

body.factun-app .app-content::-webkit-scrollbar {
  width: 0.45rem;
}

body.factun-app .app-content::-webkit-scrollbar-thumb {
  background: rgba(18, 18, 107, 0.22);
  border-radius: 999px;
}

@media (min-width: 992px) {
  html[data-nav-layout="horizontal"] .header-nav {
    display: flex;
    align-items: stretch;
  }

  html[data-nav-layout="horizontal"] .app-sidebar {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  body.factun-app .factun-header-menu {
    display: none;
  }

  body.factun-app .factun-header-logo,
  body.factun-app .factun-header-user {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
  }

  body.factun-app .factun-header-user {
    flex: 0 1 auto;
  }
}

html[data-theme-mode="dark"] body.factun-app .footer {
  background: var(--custom-white, #1a1c2e);
}

html[data-theme-mode="dark"] body.factun-app .footer a {
  color: #c9cbe8;
}

html[data-theme-mode="light"] .dark-layout,
html:not([data-theme-mode="dark"]) .dark-layout {
  display: none !important;
}

html[data-theme-mode="dark"] .light-layout {
  display: none !important;
}

.diseno-preview {
  border: 1px solid var(--default-border, #e9edf6);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  min-height: 140px;
  padding: 14px;
}

.diseno-preview-clasico .diseno-preview-bar {
  height: 10px;
  width: 55%;
  border-radius: 4px;
  background: #1f2937;
  margin-bottom: 16px;
}

.diseno-preview-moderno .diseno-preview-bar {
  height: 28px;
  margin: -14px -14px 16px;
  background: #F66D3A;
}

.diseno-preview-lines span {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
  margin-bottom: 8px;
}

.diseno-preview-lines span:nth-child(2) { width: 82%; }
.diseno-preview-lines span:nth-child(3) { width: 64%; }

@media print {
  html:has(body.factun-app),
  body.factun-app,
  body.factun-app .page,
  body.factun-app .app-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .app-header,
  .app-sidebar,
  .footer,
  .scrollToTop,
  #responsive-overlay,
  #loader,
  #switcher-canvas,
  .page-header-breadcrumb,
  .sidemenu-toggle {
    display: none !important;
  }

  .page,
  .main-content,
  .app-content,
  .container-fluid,
  .card,
  .custom-card,
  .col-xl-9,
  .col-xl-12 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: #fff !important;
  }

  .col-xl-3 {
    display: none !important;
  }
}

.fs-editor {
  margin-left: auto;
  margin-right: auto;
}

.fs-logo-edit {
  position: relative;
  display: block;
  cursor: pointer;
  width: 160px;
  text-align: right;
}

.fs-logo-edit .fs-logo,
.fs-logo-edit .fs-logo-fallback {
  width: var(--logo-w, 160px);
  height: var(--logo-h, 80px);
}

.fs-logo-hint {
  display: block;
  font-size: 10px;
  color: #F66D3A;
  text-align: center;
  margin-top: 4px;
}

.fs-editor .form-control-light {
  background: #fff8f4;
  border: 1px dashed #f0c2ad;
}

.fs-edit-label {
  font-size: 10px;
  font-weight: 700;
  margin: 10px 0 4px;
}

.fs-sample {
  opacity: 0.85;
}

.diseno-pick {
  position: relative;
  display: block;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
}

.diseno-pick-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.diseno-pick-badge {
  display: none;
}

.diseno-pick.is-active {
  border-color: #675dd1;
  box-shadow: 0 0 0 1px #675dd1;
}

.diseno-pick.is-active .diseno-pick-badge {
  display: inline-flex;
}

.diseno-pick-name {
  font-weight: 700;
  margin-right: 8px;
}

.diseno-plan {
  border: 1px solid var(--default-border, #e5e7eb);
}

.diseno-plan.is-active {
  border-color: #675dd1;
  box-shadow: 0 0 0 1px #675dd1;
}

.diseno-galeria.is-active {
  border-color: #675dd1;
  box-shadow: 0 0 0 1px #675dd1;
}

.diseno-thumb {
  position: relative;
  height: 140px;
  padding: 14px 16px;
  background: #f4f5f9;
  overflow: hidden;
}

.diseno-thumb-sm {
  height: 96px;
}

.diseno-thumb-brand,
.diseno-thumb-box,
.diseno-thumb-line {
  display: block;
  border-radius: 3px;
}

.diseno-thumb-brand {
  width: 38%;
  height: 18px;
  background: #c5c9d6;
  margin-bottom: 10px;
}

.diseno-thumb-box {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34%;
  height: 42px;
  background: #675dd1;
}

.diseno-thumb-line {
  width: 100%;
  height: 8px;
  background: #dfe2ea;
  margin-top: 8px;
}

.diseno-thumb-line.short {
  width: 55%;
}

.diseno-thumb-clasico .diseno-thumb-box {
  background: #111827;
}

.diseno-thumb-moderno .diseno-thumb-box {
  background: #675dd1;
}

.diseno-thumb-sin-logo .diseno-thumb-box {
  background: #33A6A2;
}

.diseno-thumb-sin-logo .diseno-thumb-brand {
  height: 28px;
  width: 52%;
  background: #2d3542;
}

.design-moderno .fs-logo-edit.md-logo-edit {
  width: 100%;
  max-width: 100%;
  height: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.design-moderno .fs-logo-edit.md-logo-edit .md-logo,
.design-moderno .fs-logo-edit.md-logo-edit .md-logo-fallback {
  width: var(--logo-w, auto);
  height: var(--logo-h, 24mm);
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: auto;
}

.design-moderno .fs-logo-edit.md-logo-edit .fs-logo-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
}

.design-moderno .fs-editor .form-control-light {
  background: #fff;
  border: 1px dashed #c5c6de;
}

.design-moderno .fs-editor .md-nota-iva {
  text-align: left;
}

.linea-doc-table {
  width: 100%;
}

.linea-doc-table .linea-desc-cell {
  min-width: 280px;
  white-space: normal;
  vertical-align: top;
}

.linea-desc-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.linea-desc-toolbar .btn {
  padding: 2px 8px;
  line-height: 1.2;
}

.linea-desc-editor {
  min-height: 72px;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 400;
}

.linea-desc-editor strong,
.linea-desc-editor b,
.linea-concepto strong,
.linea-concepto b {
  font-weight: 700;
}

.linea-concepto {
  font-weight: 400;
  white-space: pre-wrap;
  word-break: break-word;
}

.linea-desc-editor:empty:before {
  content: attr(data-placeholder);
  color: #9aa0b5;
}

.badge.dropdown-toggle {
  cursor: pointer;
}

.badge.dropdown-toggle::after {
  margin-left: 0.35em;
  vertical-align: 0.15em;
}

.factun-docs-card,
.factun-docs-card .card-body,
.factun-docs-table {
  overflow: visible !important;
}

.factun-docs-table {
  min-height: 60vh;
}

body.factun-app table.factun-datatable td .btn-icon {
  width: 1.75rem;
  height: 1.75rem;
}

body.factun-app .dataTables_wrapper .dataTables_filter input {
  min-width: 12rem;
}

body.factun-app .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: rgb(var(--primary-rgb)) !important;
  border-color: rgb(var(--primary-rgb)) !important;
  color: #fff !important;
}

.factun-edit-page .page-title,
.factun-edit-page .card-title,
.factun-edit-page .form-label {
  color: #12126b;
}

.factun-user {
  padding-block: 0.35rem !important;
  padding-inline: 0.7rem !important;
  min-height: 3.5rem;
  justify-content: center;
}

.factun-user-meta {
  display: block;
  text-align: center;
}

.factun-user-name {
  color: #12126b;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.15;
  display: block;
}

.factun-user-company {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
  max-width: 12rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(18, 18, 107, 0.08);
  color: #12126b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.factun-user-company i {
  font-size: 0.85rem;
  opacity: 0.85;
}

.factun-user-drophead {
  padding: 0.9rem 1rem 0.75rem;
  background: rgba(18, 18, 107, 0.05);
  text-align: center;
}

html[data-theme-mode="dark"] .factun-user-name,
html[data-theme-mode="dark"] .factun-user-company {
  color: #e8e9f8 !important;
}

html[data-theme-mode="dark"] .factun-user-company,
html[data-theme-mode="dark"] .factun-user-drophead {
  background: rgba(232, 233, 248, 0.08) !important;
}

.diseno-edit-workspace {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  margin: 0 0 1.5rem;
}

.diseno-estilo-panel {
  position: sticky;
  top: 80px;
  z-index: 6;
  width: 300px;
  flex: 0 0 300px;
  padding: 24px 22px 22px;
  border: 1px solid #eceef5;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(18, 18, 107, 0.12);
  font-size: 16px;
}

.diseno-estilo-kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f66d3a;
  margin-bottom: 0.3rem;
}

.diseno-estilo-title {
  font-size: 24px;
  font-weight: 800;
  color: #12126b;
  margin: 0 0 8px;
  line-height: 1.2;
}

.diseno-estilo-hint {
  font-size: 15px;
  line-height: 1.45;
  color: #6b7280;
  margin-bottom: 16px;
}

.diseno-estilo-label {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #12126b;
  margin: 16px 0 8px;
}

.diseno-estilo-color {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diseno-estilo-color input[type="color"] {
  width: 48px;
  height: 44px;
  padding: 0;
  border: 1px solid #d7dbe7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.diseno-estilo-color input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 1px solid #d7dbe7;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 16px;
  font-family: ui-monospace, Consolas, monospace;
  color: #12126b;
}

.diseno-estilo-swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  margin-top: 10px;
}

.diseno-estilo-swatch {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(18, 18, 107, 0.12);
}

.diseno-estilo-swatch.is-active {
  border-color: #12126b;
}

.diseno-estilo-panel .form-select {
  height: 44px;
  font-size: 16px;
  border-color: #d7dbe7;
  color: #12126b;
}

.diseno-estilo-reset {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: #f4f5fb;
  color: #12126b;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.diseno-estilo-reset:hover {
  background: #eceef8;
}

.diseno-estilo-size {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.diseno-estilo-size label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 6px;
}

.diseno-estilo-size input[type="number"] {
  width: 100%;
  height: 42px;
  border: 1px solid #d7dbe7;
  border-radius: 10px;
  padding: 0 10px;
  color: #12126b;
  font-size: 16px;
}

.diseno-estilo-size input[type="range"] {
  width: 100%;
  margin-top: 6px;
  accent-color: #f66d3a;
}

.diseno-edit-preview {
  width: 210mm;
  max-width: 100%;
  flex: 0 0 auto;
}

.diseno-edit-preview .print-sheet {
  margin: 0 auto;
}

@media (max-width: 1200px) {
  .diseno-edit-workspace {
    flex-direction: column;
    align-items: center;
  }

  .diseno-estilo-panel {
    position: sticky;
    top: 72px;
    width: min(210mm, 100%);
    flex-basis: auto;
  }
}
