@font-face {
  font-family: TrajanPro;
  src: url(/fonts/TrajanPro-Regular.ttf);
}
body {
  overflow-x: hidden;
}
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}
textarea {
  resize: none;
}
#loader {
  position: fixed;
  top: 0;
  z-index: 1032;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: #273349;
}
.hide {
  display: none;
}
#loader .loader {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.loader-search {
  text-align: center;
  padding: 10px 0;
}
.count-label {
  display: inline-block;
  background: linear-gradient(to bottom, #ff9500, #d63384);
  text-align: center;
  line-height: 1;
  font-size: 0.7rem;
  padding: 0.2rem;
  border-radius: 1rem;
  color: white;
  min-width: 1.1rem;
  min-height: 1rem;
  margin-right: 5px;
}
.p-relative {
  position: relative;
}
.help-pass:hover .help-list {
  display: block;
}
.help-list {
  display: none;
  position: absolute;
  background-color: gray;
  color: white;
  padding: 10px 13px;
  border-radius: 5px;
  z-index: 9;
}
.help-list li {
  margin: 0;
}
#listNotifications {
  overflow-y: scroll;
  max-height: calc(100vh - 150px);
}
.modal-footer button > i {
  margin-left: 5px;
  font-size: 12px;
  transform: translateY(-1px);
}
.custom-control {
  position: relative;
  display: inline-flex;
  min-height: 1.5rem;
  padding-left: 1.5rem;
}
.custom-control-input {
  width: 20px;
}
.custom-control-label {
  font-size: 18px;
}
.custom-file {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 35px;
  margin-bottom: 0;
}
.custom-file-label {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  height: 35px;
  padding: 0.35rem 0.55rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  font-size: 13px;
}
.custom-file-input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 35px;
  margin: 0;
  opacity: 0;
}
/* Search membership */
.table-membership-info td {
  text-align: center;
  font-weight: bold;
  font-size: large;
}
.table-membership-info span {
  display: block;
  font-weight: 100;
  font-size: medium !important;
  padding-top: 5px;
}
.membership-profile-data {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.membership-profile-data img {
  width: 200px;
  max-height: 200px;
  border: 2px solid white;
  border-radius: 8px;
}
.no-b {
  border-top: none !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

/* SAP - MyInventory */
.uploadFile {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px dashed #fff;
  border-radius: 8px;
  cursor: pointer;
}
.modal input[type="file"]:not(.visible) {
  visibility: hidden;
  width: 0;
  height: 0;
}

/* Membership CSS */
.uploadFileMembership,
.uploadFileMembershipRenew {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px dashed #fff;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
}
.card-front {
  display: fleX;
  justify-content: center;
  flex-direction: column;
  height: 324.95px;
  background-color: white;
  border-radius: 8px;
}
.card-img {
  display: flex;
  justify-content: center;
  padding: 25px 0 15px 0;
}
.card-name {
  background-color: #012d46;
  text-align: center;
  padding: 7px 0 5px 0;
  font-family: TrajanPro;
}
.card-code {
  display: fleX;
  justify-content: center;
  padding-top: 10px;
}
.card-expiration {
  color: black;
  font-family: TrajanPro;
  text-align: center;
  font-size: smaller;
  font-weight: bold;
  transform: translateY(-15px);
}
.card-back img {
  width: 100%;
  border-radius: 8px;
}

/* User View */
.searchList {
  display: none;
  position: absolute;
  width: 100%;
  max-height: calc(100vh - 350px);
  background-color: #2a374f;
  border: 1px solid #3c4e71;
  border-radius: 6px;
  overflow-y: auto;
  z-index: 10;
}
.searchList ul {
  list-style: none;
  overflow-y: auto;
}
.searchList li {
  width: 100%;
}
.searchList li:first-of-type {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}
.searchList li:last-of-type {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}
.searchList a {
  display: block;
  width: 100%;
  color: white;
  padding: 10px;
  text-decoration: none;
  border-radius: inherit;
}
.searchList a:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

/* Table request view modal */
td {
  position: relative;
}
.input-container {
  position: absolute;
  display: inline-block;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 2px solid white;
  border-radius: 3px;
}
#Trequest {
  width: 100%;
  text-align: center;
}
#Trequest span {
  font-size: large;
  font-weight: bold;
  padding-bottom: 5px;
}
#Trequest p {
  font-size: larger;
  margin: 0;
  padding-top: 5px;
}
#TSystems input,
#TDevices input {
  width: 100%;
  height: 100%;
  background-color: transparent;
  border: none;
}

#confirm-modal {
  z-index: 1056;
}

/* Blink Animation */
@keyframes blink {
  0% {
    color: red;
  }
  100% {
    color: white;
  }
}
@-webkit-keyframes blink {
  0% {
    color: red;
  }
  100% {
    color: white;
  }
}
.blink {
  -webkit-animation: blink 1s linear infinite;
  -moz-animation: blink 1s linear infinite;
  animation: blink 1s linear infinite;
}
@keyframes bg-blink {
  0% {
    background-color: red;
  }
  100% {
    background-color: inherit;
  }
}
@-webkit-keyframes bg-blink {
  0% {
    background-color: red;
  }
  100% {
    background-color: inherit;
  }
}
.bg-blink {
  -webkit-animation: bg-blink 1s linear infinite;
  -moz-animation: bg-blink 1s linear infinite;
  animation: bg-blink 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@-webkit-keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.spin {
  -webkit-animation: spin 1s linear infinite;
  -moz-animation: spin 1s linear infinite;
  animation: spin 1s linear infinite;
}

/* ── Permission chips (settings editor) ─────────────────────────── */
.perm-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
  font-size: 0.78rem;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.perm-chip:hover {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
  cursor: pointer;
}
.perm-chip--on {
  background: rgba(32, 201, 151, 0.12);
  border-color: rgba(32, 201, 151, 0.45);
  color: #20c997;
}
.perm-chip--on:hover {
  border-color: rgba(32, 201, 151, 0.85);
}
.perm-chip .perm-chip__icon {
  transition: color 0.15s;
}

/* ── Systems editor ─────────────────────────────────────────────────── */
.sys-item .accordion-button {
  font-size: 0.9rem;
}
.sys-item .sys-levels-list .sys-level-row {
  transition: background 0.1s;
}
.sys-item .sys-levels-list .sys-level-row:hover {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}
.btn-outline-teal {
  color: #20c997;
  border-color: rgba(32, 201, 151, 0.5);
  background: transparent;
}
.btn-outline-teal:hover {
  color: #fff;
  background-color: #20c997;
  border-color: #20c997;
}
.btn-xs {
  padding: 2px 7px;
  font-size: 0.75rem;
  line-height: 1.4;
  border-radius: 4px;
}
/* ── Kanban board ── */
.kanban-wrap {
  overflow-x: auto;
  padding-bottom: 2rem;
}
.kanban-board {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1rem;
  min-width: max-content;
}
.kanban-col {
  width: auto;
  display: flex;
  flex-direction: column;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(255, 255, 225, 0.08);
  flex-shrink: 0;
}
.kanban-col-header {
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.79rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: 0.75rem 0.75rem 0 0;
}
.kanban-col[data-status="UNASSIGNED"] .kanban-col-header {
  background: rgba(108, 117, 125, 0.18);
  border-bottom: 2px solid rgba(108, 117, 125, 0.55);
}
.kanban-col[data-status="IN_PROGRESS"] .kanban-col-header {
  background: rgba(255, 193, 7, 0.12);
  border-bottom: 2px solid rgba(255, 193, 7, 0.65);
}
.kanban-col[data-status="COMPLETED"] .kanban-col-header {
  background: rgba(32, 201, 151, 0.1);
  border-bottom: 2px solid rgba(32, 201, 151, 0.6);
}
.kanban-col[data-status="CANCELLED"] .kanban-col-header {
  background: rgba(220, 53, 69, 0.1);
  border-bottom: 2px solid rgba(220, 53, 69, 0.5);
}
.kanban-col-body {
  flex: 1;
  padding: 0.6rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.2s;
  border-radius: 0 0 0.75rem 0.75rem;
}
.kanban-col.drag-over .kanban-col-body {
  background: rgba(0, 0, 0, 0.07);
  outline: 2px dashed rgba(0, 0, 0, 0.22);
  outline-offset: -4px;
}
/* ── Task cards ── */
.task-card {
  background: rgba(0, 0, 0, 0.055);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 0.55rem;
  padding: 0.7rem 0.8rem 0.65rem 1.1rem;
  cursor: grab;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    opacity 0.15s,
    border-color 0.15s;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  border-color: rgba(0, 0, 0, 0.2);
}
.task-card.dragging {
  opacity: 0.3;
  cursor: grabbing;
  transform: scale(0.97);
}
.task-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.task-card[data-priority="CRITICAL"]::before {
  background: #dc3545;
}
.task-card[data-priority="HIGH"]::before {
  background: #fd7e14;
}
.task-card[data-priority="MEDIUM"]::before {
  background: #0dcaf0;
}
.task-card[data-priority="LOW"]::before {
  background: #6c757d;
}
.task-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  word-break: break-word;
}
.task-card-meta {
  font-size: 0.74rem;
  color: rgba(0, 0, 0, 0.48);
  line-height: 1.75;
}
.task-card-meta i {
  width: 14px;
  text-align: center;
  opacity: 0.7;
}
.task-card-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.55rem;
}
.kanban-empty {
  text-align: center;
  padding: 2rem 0.75rem;
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  border: 2px dashed rgba(255, 255, 255, 0.07);
  border-radius: 0.45rem;
  pointer-events: none;
}
.kanban-count {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  background: rgba(0, 0, 0, 0.3) !important;
  border-radius: 20px;
}
.task-card .btn {
  font-size: 0.7rem;
}
/* ── Stats ── */
.stat-mini {
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.03);
  text-align: center;
}
.stat-mini h3 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
  line-height: 1;
}
.stat-mini small {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
}
/* ── Filter bar ── */
.filter-bar {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.6rem;
  padding: 0.6rem 0.9rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.filter-bar .form-control,
.filter-bar .form-select {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(255, 255, 255, 0.1) !important;
  font-size: 0.8rem;
  height: 32px;
  padding: 0.2rem 0.55rem;
}
.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
  background: rgba(0, 0, 0, 0.09);
  border-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: none;
}
option {
  background: #212837;
}
/* ── Create modal sections ── */
.form-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.65rem;
  padding: 1rem 1rem 0.6rem;
  background: rgba(0, 0, 0, 0.02);
  margin-bottom: 0.9rem;
}
.form-section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
}
.step-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}
/* ── Location cards ── */
.loc-card-wrap {
  display: flex;
  gap: 0.75rem;
}
.loc-card {
  flex: 1;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.65rem;
  padding: 0.9rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  user-select: none;
}
.loc-card:hover {
  border-color: rgba(0, 0, 0, 0.28);
  background: rgba(0, 0, 0, 0.05);
}
.btn-check:checked + .loc-card {
  border-color: #0dcaf0;
  background: rgba(13, 202, 240, 0.1);
  color: #0dcaf0;
}
.loc-card .loc-icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 0.3rem;
  line-height: 1;
}
.loc-card .loc-label {
  font-size: 0.82rem;
  font-weight: 600;
}
/* ── Priority pills ── */
.prio-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.prio-pills .btn-check:checked + label {
  font-weight: 700;
}
/* ── Photo upload area ── */
.photo-drop {
  border: 2px dashed rgba(0, 0, 0, 0.12);
  border-radius: 0.6rem;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.15s;
  cursor: pointer;
}
.photo-drop:hover {
  border-color: rgba(0, 0, 0, 0.3);
}
.photo-drop label {
  cursor: pointer;
  width: 100%;
}

/* ═══════════════════════════════════════════════════
   MOBILE PWA — Tareas
   ═══════════════════════════════════════════════════ */

/* ── Filter bar desktop ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar .form-control { width: 220px; }
.filter-bar .form-select  { width: 170px; }
.filter-bar-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

@media (max-width: 767.98px) {

  /* ── Stats strip: compact ── */
  .stat-mini {
    padding: 0.55rem 0.5rem;
  }
  .stat-mini h3 {
    font-size: 1.3rem;
  }
  .stat-mini small {
    font-size: 0.63rem;
  }

  /* ── Header action: full-width button ── */
  .d-flex.align-items-center.justify-content-between.mb-2.flex-wrap > a,
  .d-flex.align-items-center.justify-content-between.mb-2.flex-wrap > button {
    width: 100%;
    justify-content: center;
  }

  /* ── Filter bar: stack vertical, full width ── */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem 0.75rem;
    gap: 0.4rem;
  }
  .filter-bar .form-control,
  .filter-bar .form-select {
    width: 100% !important;
    font-size: 0.9rem;
  }
  .filter-bar-actions {
    width: 100%;
  }
  .filter-bar-actions .btn {
    flex: 1;
    font-size: 0.82rem;
  }

  /* ── Kanban: swipeable horizontal snap ── */
  .kanban-wrap {
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -0.9rem;
    margin-right: -0.9rem;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
    padding-bottom: 1.25rem;
    position: relative;
  }
  .kanban-wrap::-webkit-scrollbar {
    display: none;
  }
  /* swipe hint */
  .kanban-wrap::after {
    content: "← desliza →";
    display: block;
    text-align: center;
    font-size: 0.68rem;
    opacity: 0.4;
    margin-top: 0.4rem;
    letter-spacing: 0.05em;
  }
  .kanban-board {
    display: flex;
    flex-direction: row;
    min-width: unset;
    gap: 0.65rem;
    padding-right: 0.9rem;
  }
  .kanban-col {
    scroll-snap-align: start;
    width: calc(100vw - 2.4rem);
    min-width: calc(100vw - 2.4rem);
    flex-shrink: 0;
    max-height: calc(100dvh - 320px);
  }
  .kanban-col-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100dvh - 400px);
  }

  /* ── Task cards: bigger touch targets ── */
  .task-card {
    padding: 0.8rem 0.8rem 0.8rem 1.1rem;
    cursor: pointer;
  }
  .task-card-title {
    font-size: 0.92rem;
  }
  .task-card-actions .btn {
    padding: 0.42rem 0.7rem;
    font-size: 0.8rem;
    min-height: 36px;
  }
  .task-card .btn {
    font-size: 0.8rem;
  }

  /* ── Fullscreen modal tweaks ── */
  .modal-fullscreen-md-down .modal-body {
    padding: 1rem;
  }
  .modal-fullscreen-md-down .form-section {
    padding: 0.75rem;
    margin-bottom: 0.65rem;
  }
  .modal-fullscreen-md-down .modal-footer {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .modal-fullscreen-md-down .modal-footer .btn {
    flex: 1;
  }

  /* Priority pills: horizontal scroll, no wrap */
  .prio-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }
  .prio-pills::-webkit-scrollbar { display: none; }
  .prio-pills .btn {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 38px;
  }

  /* Location cards: taller touch area */
  .loc-card {
    padding: 1.1rem 0.75rem;
  }
  .loc-card .loc-icon {
    font-size: 2rem;
  }

  /* Comments: fill available space in fullscreen modal */
  #commentsContainer {
    max-height: calc(100dvh - 480px) !important;
    min-height: 120px;
  }

  /* Photo drop: more compact on small screens */
  .photo-drop {
    padding: 0.75rem;
  }
}

/* ── DataTables Responsive: fix dtr-control toggle overlap ─────────
   El plugin añade el ícono toggle como ::before inline-block, pero
   DataTables ya calculó el ancho de la columna sin contar ese ícono
   (table-layout:fixed), así que el texto de la col 1 y la col 2
   se superponen visualmente.
   Solución: convertir el ::before a position:absolute (ya que td
   tiene position:relative globalmente) y reservar padding-left.       */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
  padding-left: 30px !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  margin-right: 0;
  display: block;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — xs (≤ 575px) — DataTables & card headers
   ═══════════════════════════════════════════════════ */
@media (max-width: 575.98px) {

  /* ── Reduce card padding ── */
  .card-body {
    padding: 0.85rem;
  }

  /* ── Card header row: stack title / filters / action vertically ── */
  #datatable > .d-flex {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.65rem;
  }

  /* Title: keep icon + h4 in one line */
  #datatable > .d-flex > .d-flex {
    align-items: center;
  }

  /* Filter/button inner row: column, each item full-width */
  #datatable > .d-flex > div > .d-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  /* Each wrapper div inside the filter row: full width */
  #datatable > .d-flex > div > .d-flex > div {
    width: 100%;
  }

  /* Every select and button in the header: full width */
  #datatable > .d-flex .form-select,
  #datatable > .d-flex .btn {
    width: 100%;
    box-sizing: border-box;
  }

  /* ── Pattern 2: external filter bars (memberships, contracts, invoices,
        suppliers, extensions, memberships-renewed)
        Structure: .col-xl-12 > .d-flex.justify-content-end  ── */
  .col-xl-12 > .d-flex.justify-content-end {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.4rem;
  }

  /* Each child div (wraps a select or a button) becomes full-width */
  .col-xl-12 > .d-flex.justify-content-end > div {
    width: 100%;
    margin-right: 0 !important;
  }

  /* Selects & buttons inside those divs: full-width.
     !important is needed because invoices.pug adds inline style="max-width:500px" */
  .col-xl-12 > .d-flex.justify-content-end .form-select,
  .col-xl-12 > .d-flex.justify-content-end .btn {
    width: 100% !important;
    box-sizing: border-box;
    max-width: none !important;
  }

  /* ── DataTables: right-col alignment fix ── */
  .dataTables_wrapper .col-sm-8 {
    text-align: left !important;
  }

  /* Search+buttons flex: left-align, wrap */
  .dataTables_wrapper .col-sm-8 .d-flex.justify-content-end {
    justify-content: flex-start !important;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Search container grows to fill the row */
  .dataTables_wrapper .col-sm-8 .me-1 {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Search label: flex so input fills remaining space */
  .dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    white-space: nowrap;
  }
  .dataTables_wrapper .dataTables_filter input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
  }

  /* Length label: left-align */
  .dataTables_wrapper .dataTables_length {
    text-align: left;
  }

  /* Print/CSV buttons: wrap */
  .dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  /* ── DataTables bottom row: info + pagination ── */
  .dataTables_wrapper > .d-flex.align-items-center.mt-3 {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  .dataTables_wrapper > .d-flex.align-items-center.mt-3 .me-auto {
    flex: 1 1 100%;
  }
  .dataTables_wrapper > .d-flex.align-items-center.mt-3 .mb-0 {
    width: 100%;
  }
  .dataTables_wrapper .pagination {
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
  }
  .dataTables_wrapper .page-item .page-link {
    padding: 0.3rem 0.55rem;
    font-size: 0.82rem;
  }

  /* ── Responsive child rows (collapsed columns) ── */
  table.dataTable > tbody > tr.child ul.dtr-details {
    width: 100%;
  }
  table.dataTable > tbody > tr.child ul.dtr-details > li {
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0.4rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  table.dataTable > tbody > tr.child ul.dtr-details > li span.dtr-title {
    font-weight: 600;
    opacity: 0.65;
    flex: 0 0 auto;
    min-width: 30%;
  }
  table.dataTable > tbody > tr.child ul.dtr-details > li span.dtr-data {
    flex: 1 1 auto;
    word-break: break-word;
  }

  /* ── Modals: more padding on xs ── */
  .modal-dialog {
    margin: 0.5rem;
  }
  .modal-body {
    padding: 1rem;
  }
  .modal-footer {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .modal-footer .btn {
    flex: 1 1 auto;
  }

  /* ── App header: shrink brand logo area ── */
  .app-header .brand {
    min-width: 0;
  }

  /* ── Utility: ensure no horizontal overflow ── */
  .app-content {
    overflow-x: hidden;
  }
  .row {
    --bs-gutter-x: 0.75rem;
  }
}

/* ═══════════════════════════════════════════════════
   INVOICE SUMMARY MODAL
   ═══════════════════════════════════════════════════ */

/* Filter context pills */
.smry-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: .22rem .8rem;
  font-size: .78rem;
  color: rgba(255,255,255,.72);
}

/* Stat cards */
.smry-card {
  background: rgba(0,0,0,.06);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: .65rem;
  padding: 1rem .75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.smry-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: rgba(255,255,255,.12);
  border-radius: .65rem .65rem 0 0;
}
.smry-card--dop::before { background: #ffd43b; }
.smry-card--usd::before { background: #51cf66; }
.smry-card--exc::before { background: #74c0fc; }
.smry-card-icon { font-size: 1.3rem; opacity: .4; margin-bottom: .3rem; }
.smry-card-val  { font-size: 1.15rem; font-weight: 700; line-height: 1.2; margin-bottom: .2rem; }
.smry-card-lbl  { font-size: .67rem; text-transform: uppercase; letter-spacing: .06em; opacity: .5; }

/* Section panels */
.smry-section {
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: .65rem;
  padding: 1rem 1.1rem;
}
.smry-section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .65;
  margin-bottom: .8rem;
}

/* Detail table */
.smry-tbl th {
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .5;
  font-weight: 600;
  border-top: none;
  padding-bottom: .4rem;
}
.smry-tbl td { font-size: .82rem; vertical-align: middle; }
.smry-total-row td {
  border-top: 2px solid rgba(255,255,255,.15) !important;
  font-size: .88rem;
  padding-top: .65rem;
}

/* ── Print: show only the summary modal ── */
@media print {
  body, html { background: #fff !important; }
  #app > * { display: none !important; }
  .modal-backdrop { display: none !important; }
  #invoice-summary-modal {
    display: block !important;
    position: static !important;
    overflow: visible !important;
  }
  #invoice-summary-modal .modal-dialog {
    max-width: 100% !important;
    margin: 0 !important;
    transform: none !important;
  }
  #invoice-summary-modal .modal-content {
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #212529 !important;
  }
  #invoice-summary-modal .modal-body { overflow: visible !important; }
  .d-print-none { display: none !important; }
  .smry-pill    { background: #f1f3f5 !important; color: #495057 !important; border-color: #dee2e6 !important; }
  .smry-card    { background: #f8f9fa !important; border: 1px solid #dee2e6 !important; color: #212529 !important; break-inside: avoid; }
  .smry-section { background: #f8f9fa !important; border: 1px solid #dee2e6 !important; color: #212529 !important; break-inside: avoid; }
  .smry-section-title, .smry-card-lbl, .smry-card-icon { color: #495057 !important; opacity: 1 !important; }
  .smry-tbl th, .smry-tbl td { color: #212529 !important; }
  .smry-total-row td { border-top: 2px solid #dee2e6 !important; }
  .text-muted { color: #6c757d !important; }
  .badge { border: 1px solid #dee2e6 !important; color: #212529 !important; background: #e9ecef !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .progress { background: #e9ecef !important; }
  .smry-card::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ══════════════════════════════════════════════════════════
   Cookie Consent Banner
   ══════════════════════════════════════════════════════════ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #1a1d23;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.5rem;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
  font-size: 0.875rem;
}

.cookie-banner-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.cookie-banner-text strong {
  color: #fff;
}

.btn-link-cookie {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
  font-size: inherit;
  cursor: pointer;
  vertical-align: baseline;
}

.btn-link-cookie:hover {
  color: #fff;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}

/* Detalles expandibles */
.cookie-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.cookie-detail-row {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.cookie-detail-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.35rem;
}

.cookie-detail-header strong {
  color: #fff;
  font-size: 0.8125rem;
}

.cookie-detail-row p,
.cookie-detail-row li {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.15rem;
}

.cookie-detail-row code {
  color: #7ec8e3;
  font-size: 0.78em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.cookie-detail-row ul {
  padding-left: 1.1rem;
  margin-bottom: 0;
}

/* Enlace "Gestionar cookies" en sidebar */
[data-cookie-manage] {
  cursor: pointer;
}

/* ── Responsive ─────────────────────── */
@media (max-width: 575.98px) {
  .cookie-banner {
    padding: 0.85rem 1rem;
  }
  .cookie-banner-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .cookie-banner-actions {
    width: 100%;
  }
  .cookie-banner-actions .btn {
    flex: 1;
    text-align: center;
  }
  .cookie-details {
    grid-template-columns: 1fr;
  }
}
