/**
 * Mochileitor - Estilos personalizados adicionales
 */

/* Utilidades */
.text-earth {
    color: var(--earth) !important;
}

.bg-light-earth {
    background-color: #f8f5f0;
}

.weight-display {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Hero */
.mochila-hero .lead {
    font-size: 1.15rem;
    opacity: 0.9;
}

/* Cards de mochila */
.mochila-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mochila-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mochila-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(46, 58, 31, 0.12) !important;
}

.mochila-card-content {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    min-height: 118px;
}

.mochila-card-cover {
    width: 104px;
    height: 104px;
    object-fit: contain;
    display: block;
    margin: 0;
    padding: 0.35rem;
    border: 1px solid #d6c7ad;
    border-radius: 6px;
    background: #fbf7ee;
    box-shadow: 0 2px 8px rgba(46, 58, 31, 0.08);
}

.mochila-card-copy {
    min-width: 0;
}

.mochila-card .card-header {
    background: linear-gradient(90deg, #2E3A1F, #3f4d2a);
    color: white;
    padding: 1rem 1.25rem;
}

.mochila-card .card-header h5 {
    font-size: calc(1.25rem - 1px);
}

.mochila-card-grid-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.4rem;
    scrollbar-color: #C75B12 #e8e0d1;
}

.dashboard-card-grid-scroll {
    max-height: calc(100vh - 230px);
    min-height: 260px;
}

.dashboard-pack-search {
    max-width: 430px;
}

.pack-search-mode-select {
    width: 100%;
    min-width: 0;
    font-size: 0.9rem;
}

.dashboard-pack-search .form-control,
.dashboard-pack-search .input-group-text {
    font-size: 0.9rem;
}

.explorar-card-grid-scroll {
    max-height: calc(100vh - 285px);
    min-height: 320px;
}

.mochila-card-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.public-pack-metrics {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    color: #5C4636;
    font-size: 0.82rem;
    border-top: 1px solid #eee3d3;
    padding-top: 0.65rem;
}

.editor-public-metric {
    min-width: 42px;
    padding: 0.28rem 0.45rem;
    border: 1px solid #d6c7ad;
    border-radius: 4px;
    background: #fbf7ee;
    color: #4b5f2b;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.05;
}

.editor-public-metric strong {
    display: block;
    color: #2E3A1F;
    font-size: 0.78rem;
}

.editor-cover-panel {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    padding: 0.28rem;
    border: 1px solid #e0d2bb;
    border-radius: 6px;
    background: #fbf7ee;
}

.editor-cover-preview {
    width: 112px;
    height: 76px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #d6c7ad;
    background: #e8e0d1;
}

.editor-cover-action {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    border: 1px solid #d6c7ad;
    border-radius: 5px;
    background: #e8e0d1;
    overflow: hidden;
    cursor: pointer;
}

.editor-cover-action:focus-visible {
    outline: 2px solid rgba(46, 58, 31, 0.35);
    outline-offset: 2px;
}

.editor-cover-action .editor-cover-preview {
    display: block;
    border: 0;
    border-radius: 0;
}

.editor-cover-action-clip {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(46, 58, 31, 0.22);
    background: rgba(255, 255, 255, 0.9);
    color: #52602f;
    font-size: 0.8rem;
    pointer-events: none;
}

.editor-cover-preview-mini {
    display: block;
}

.editor-cover-mini {
    width: 112px;
}

.editor-cover-clip-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: rgba(46, 58, 31, 0.35);
    background: rgba(255, 255, 255, 0.88);
}

.editor-cover-clip-btn:hover {
    background: #fff;
}

.editor-cover-controls {
    width: 132px;
}

.editor-cover-select,
.editor-cover-upload {
    min-height: 26px;
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
    font-size: 0.68rem;
    line-height: 1.1;
}

.editor-cover-upload {
    margin-top: 0.3rem;
    color: #6f6659;
    border-color: #d8cbb9;
}

.editor-cover-controls .small {
    margin-top: 0.2rem;
    font-size: 0.62rem;
    line-height: 1.1;
}

.editor-star-legend {
    max-width: 680px;
}

.report-weight-meter {
    padding: 0.55rem 0.65rem;
    border: 1px solid #e0d2bb;
    border-radius: 0.65rem;
    background: #fbf7ee;
}

.report-weight-scale {
    position: relative;
    display: flex;
    height: 23px;
    margin-top: 1.35rem;
    overflow: visible;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 1px 5px rgba(46, 58, 31, 0.18);
}

.report-weight-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-weight-light {
    width: 50%;
    border-radius: 999px 0 0 999px;
    background: #4a8c42;
}

.report-weight-medium {
    width: 25%;
    color: #4d3a08;
    background: #f4c542;
}

.report-weight-heavy {
    width: 25%;
    border-radius: 0 999px 999px 0;
    background: #c44a3d;
}

.report-weight-marker {
    position: absolute;
    top: -23px;
    left: 2%;
    color: #2e3a1f;
    font-size: 1.25rem;
    line-height: 1;
    transform: translateX(-50%);
    transition: left 0.35s ease;
}

.report-weight-marker::after {
    position: absolute;
    top: 18px;
    left: 50%;
    width: 3px;
    height: 27px;
    border-radius: 2px;
    background: #2e3a1f;
    content: "";
    transform: translateX(-50%);
}

.report-weight-scale-labels {
    font-size: 0.61rem;
}

.report-top-item-category {
    margin-left: 2.15rem;
    font-size: 0.64rem;
}

.report-modal-compact .modal-dialog {
    max-width: 1080px;
}

.report-modal-compact .modal-header,
.report-modal-compact .modal-footer {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.report-modal-compact .modal-title {
    font-size: 1rem;
}

.report-modal-compact .display-6 {
    font-size: 1.55rem;
}

.report-modal-compact h6 {
    font-size: 0.84rem;
}

.report-modal-compact .small,
.report-modal-compact .list-group-item {
    font-size: 0.75rem;
}

.report-modal-compact .list-group-item {
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}

.report-modal-compact #reportPie {
    max-width: 245px;
    max-height: 245px;
}

.report-modal-compact #reportCategoryDetail {
    max-height: 155px;
    overflow-y: auto;
}

.weight-report-embedded .display-6 {
    font-size: 1.55rem;
}

.weight-report-embedded h6 {
    font-size: 0.84rem;
}

.weight-report-embedded .small,
.weight-report-embedded .list-group-item {
    font-size: 0.75rem;
}

.weight-report-embedded .list-group-item {
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}

.weight-report-embedded [data-weight-report-pie] {
    max-width: 245px;
    max-height: 245px;
    cursor: pointer;
}

.weight-report-embedded [data-weight-report-detail] {
    max-height: 155px;
    overflow-y: auto;
}

.view-weight-report-panel {
    border: 1px solid rgba(46, 58, 31, 0.16);
    border-radius: 0.5rem;
    background: rgba(248, 245, 240, 0.32);
}

.view-weight-report-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.7rem;
    border: 0;
    background: transparent;
    color: #3e4a2e;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: left;
}

.view-weight-report-toggle:hover {
    background: rgba(46, 58, 31, 0.035);
}

.view-weight-report-chevron {
    color: #778364;
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.view-weight-report-toggle[aria-expanded="false"] .view-weight-report-chevron {
    transform: rotate(180deg);
}

.view-weight-report-content {
    padding: 0.75rem;
    border-top: 1px solid rgba(46, 58, 31, 0.12);
}

.editor-title-wrap {
    min-height: 31px;
}

.editor-title-input {
    width: min(320px, 52vw);
    height: 31px;
    font-size: 0.95rem;
    font-weight: 700;
}

.editor-title-action {
    width: 24px;
    height: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.editor-description-input {
    min-height: 68px;
    font-size: 0.88rem;
    line-height: 1.25;
}

.editor-pack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 1.25rem;
}

.editor-pack-tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(46, 58, 31, 0.18);
    background: #eef1e8;
    color: #3e4a2e;
    font-weight: 600;
}

.mochila-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.mochila-card-tag {
    max-width: 6.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(46, 58, 31, 0.14);
    background: #f0ede3;
    color: #6a4d15;
    font-size: 0.66rem;
    font-weight: 700;
}

.mochila-card-tag-count {
    background: #d8e1c3;
    color: #3e4a2e;
}

.item-star-preview {
    display: inline-flex;
    width: 1.1rem;
    height: 24px;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.1rem;
}

.item-star-trigger {
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 1;
    cursor: pointer;
}

.item-star-trigger:hover.item-star-none,
.item-star-trigger:focus.item-star-none {
    color: #b8afa2 !important;
    outline: none;
}

.item-external-link {
    display: inline-flex;
    width: 1.1rem;
    height: 24px;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.1rem;
}

.item-external-link:disabled {
    opacity: 0.45;
}

.inline-weight-report {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-weight-report-stats,
.inline-weight-report-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.inline-weight-report-card {
    min-width: 66px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.1;
}

.inline-weight-report-card-base {
    min-width: 78px;
    border-color: var(--bs-success);
    color: var(--bs-success);
}

.inline-weight-report-label {
    color: var(--bs-secondary-color);
    font-size: 0.65rem;
}

.inline-weight-report-value {
    font-weight: 700;
}

.inline-weight-report-category {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.item-star-select {
    display: none;
    width: auto;
    min-width: 86px;
    height: 24px;
    padding: 0 1.55rem 0 0.35rem;
    font-size: 0.68rem;
    border-color: #d6c7ad;
    border-radius: 3px;
    font-weight: 700;
    text-indent: 0;
    cursor: pointer;
    background-position: right 0.35rem center;
    background-size: 8px 6px;
}

.item-star-select.is-open {
    display: inline-block;
}

.item-star-yellow {
    color: #d4a017 !important;
}

.item-star-select.item-star-yellow {
    background-color: #fff7dd !important;
    border-color: #b8890f;
    color: #9b6d00 !important;
}

.item-star-red {
    color: #c0392b !important;
}

.item-star-select.item-star-red {
    background-color: #fde8e5 !important;
    border-color: #962d22;
    color: #9f2b20 !important;
}

.item-star-green {
    color: #4b7f2a !important;
}

.item-star-select.item-star-green {
    background-color: #e9f5e3 !important;
    border-color: #35601c;
    color: #35601c !important;
}

.item-star-blue {
    color: #2f6f9f !important;
}

.item-star-select.item-star-blue {
    background-color: #e4f2fb !important;
    border-color: #24577d;
    color: #24577d !important;
}

.item-star-purple {
    color: #7353a4 !important;
}

.item-star-select.item-star-purple {
    background-color: #f0eafb !important;
    border-color: #583d82;
    color: #583d82 !important;
}

.item-star-pink {
    color: #c94f8a !important;
}

.item-star-select.item-star-pink {
    background-color: #fde8f2 !important;
    border-color: #a83b70;
    color: #a83b70 !important;
}

.item-star-none {
    color: #d8d2c7 !important;
}

.item-star-select.item-star-none {
    background-color: #fff !important;
    border-color: #d6c7ad;
    color: #8c8376 !important;
}

.quantity-stepper {
    display: inline-grid;
    grid-template-columns: 18px 24px 18px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8cbb9;
    border-radius: 4px;
    overflow: hidden;
    background: #fffdf8;
}

.quantity-btn {
    width: 18px;
    height: 22px;
    padding: 0;
    border: 0;
    background: #f1ede4;
    color: #5C4636;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.quantity-btn:hover {
    background: #e5dac9;
}

.quantity-btn:disabled {
    opacity: 0.45;
    cursor: wait;
}

.item-quantity-value {
    min-width: 24px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 22px;
    color: #2E3A1F;
    background: #fff;
}

/* Tabla de equipo */
.gear-table {
    font-size: 0.95rem;
}

.gear-table td, .gear-table th {
    vertical-align: middle;
}

.gear-table .item-name {
    font-weight: 600;
    color: #2E3A1F;
}

/* Badge de categoría */
.cat-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background-color: #e8e0d1;
    color: #5C4636;
    font-weight: 600;
}

/* Total de peso */
.total-weight-bar {
    background: linear-gradient(90deg, #C75B12, #E07A38);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.35rem;
    font-weight: 700;
}

/* Formularios */
.form-control:focus, .form-select:focus {
    border-color: #C75B12;
    box-shadow: 0 0 0 0.25rem rgba(199, 91, 18, 0.15);
}

/* Página de imprimir */
@media print {
    .print-header {
        text-align: center;
        margin-bottom: 2rem;
        border-bottom: 3px solid #2E3A1F;
        padding-bottom: 1rem;
    }
    
    .print-header h1 {
        font-size: 1.8rem;
        color: #2E3A1F;
    }
    
    .gear-print-table {
        width: 100%;
        border-collapse: collapse;
    }
    
    .gear-print-table th,
    .gear-print-table td {
        border: 1px solid #ccc;
        padding: 8px 12px;
        text-align: left;
    }
    
    .gear-print-table th {
        background-color: #f1ede4;
    }
    
    .print-footer {
        margin-top: 2rem;
        font-size: 0.85rem;
        color: #666;
        text-align: center;
    }

/* === Estilos especificos para el Editor de Mochila === */
}

#weightPie {
    max-height: 260px;
}

/* Hacer el gráfico del informe clicable visualmente */
#reportPie,
#weightPie {
    cursor: pointer;
}

.cat-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    background-color: #e8e0d1;
    color: #3E4A2E;
    border-radius: 4px;
    font-weight: 600;
}

.editor-stat {
    transition: transform 0.2s ease;
}
.editor-stat:hover {
    transform: translateY(-1px);
}

/* === Editor ultra compacto (Excel-like) === */
.edit-page .table-sm td,
.edit-page .table-sm th {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.edit-page .cat-badge {
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
}

/* Animaciones suaves */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .mochila-hero {
        min-height: 420px;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }

    .mochila-card-content {
        grid-template-columns: 88px minmax(0, 1fr);
        min-height: 96px;
    }

    .mochila-card-cover {
        width: 88px;
        height: 88px;
    }
}

/* Editor sidebar */
.editor-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.editor-main {
    min-width: 0;
}

.editor-sidebar {
    position: sticky;
    top: 0.75rem;
    height: calc(100vh - 1.5rem);
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(46, 58, 31, 0.98), rgba(62, 74, 46, 0.98)),
        #2E3A1F;
    color: #f8f5f0;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-right: 3px solid #C75B12;
    box-shadow: 0 8px 24px rgba(46, 58, 31, 0.18);
}

.editor-sidebar-brand,
.editor-sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editor-sidebar-brand {
    font-size: 1.05rem;
}

.editor-sidebar-add,
.editor-sidebar-small-link {
    color: #E07A38;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
}

.editor-sidebar-add:hover,
.editor-sidebar-small-link:hover {
    color: #ffb071;
}

.editor-sidebar-section {
    min-height: 0;
}

.editor-sidebar-section:first-of-type {
    flex: 0 0 auto;
}

.editor-sidebar-title {
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: #fff9ec;
}

.editor-sidebar-list {
    overflow-y: auto;
    scrollbar-color: #C75B12 rgba(255,255,255,0.12);
}

.editor-pack-list {
    max-height: 125px;
}

.editor-pack-link {
    color: #fff9ec;
    text-decoration: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding: 0.5rem 0.55rem;
    border-bottom: 1px dotted rgba(248,245,240,0.24);
    font-size: 0.85rem;
    border-radius: 4px;
}

.editor-pack-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-pack-link small {
    color: #eadfc8;
}

.editor-pack-link:hover,
.editor-pack-link.active {
    background: rgba(199, 91, 18, 0.24);
    color: #fff9ec;
}

.editor-pack-link.active {
    box-shadow: inset 3px 0 0 #E07A38;
}

.editor-gear-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(248,245,240,0.18);
}

.editor-sidebar-input {
    background: rgba(248, 245, 240, 0.12);
    color: #fff9ec;
    border-color: rgba(248, 245, 240, 0.26);
}

.editor-sidebar-input::placeholder {
    color: #d9cfb7;
}

.editor-sidebar-input:focus {
    background: #fff9ec;
    color: #2E3A1F;
}

.editor-sidebar-select {
    background-color: #fff9ec;
    color: #2E3A1F;
    border-color: rgba(199, 91, 18, 0.65);
    font-weight: 600;
    cursor: pointer;
}

.editor-gear-panel .btn-outline-light {
    --bs-btn-color: #fff9ec;
    --bs-btn-border-color: rgba(248,245,240,0.35);
    --bs-btn-hover-bg: rgba(199, 91, 18, 0.22);
    --bs-btn-hover-border-color: #E07A38;
    --bs-btn-active-bg: #C75B12;
    --bs-btn-active-border-color: #C75B12;
    --bs-btn-active-color: #fff;
    font-weight: 600;
}

.editor-gear-list {
    min-height: 160px;
    flex: 1 1 auto;
    max-height: calc(100vh - 360px);
    overscroll-behavior: contain;
}

.editor-gear-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.45rem;
    border-bottom: 1px dotted rgba(248,245,240,0.24);
    cursor: default;
    border-radius: 4px;
}

.editor-gear-item:hover {
    background: rgba(199, 91, 18, 0.18);
}

.editor-gear-item-content {
    min-width: 0;
    flex: 1 1 auto;
}

.editor-gear-item-mainline {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.4rem;
}

.editor-gear-item-name {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 0.83rem;
    line-height: 1.15;
}

.editor-gear-add-mobile {
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    min-height: 38px;
    padding: 0;
}

.editor-gear-item-mobile-weight {
    flex: 0 0 auto;
    color: #fff9ec;
    font-size: 0.75rem;
    white-space: nowrap;
}

.editor-gear-item-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: #eadfc8;
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

/* Activador reutilizable para drag and drop. El resto del item conserva sus
   gestos normales (scroll, seleccion, enlaces, botones e inputs). */
.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    min-height: 34px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #887964;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.drag-handle:hover,
.drag-handle:focus-visible {
    color: var(--accent);
    background: rgba(199, 91, 18, 0.1);
}

.drag-handle:focus-visible {
    outline: 2px solid rgba(199, 91, 18, 0.55);
    outline-offset: 1px;
}

.drag-handle:active,
.sortable-chosen .drag-handle,
.drag-source-active .drag-handle {
    cursor: grabbing;
    color: var(--accent);
    background: rgba(199, 91, 18, 0.16);
}

.editor-gear-drag-handle {
    color: #d8c9ad;
}

.item-drag-cell {
    width: 34px;
    min-width: 34px;
    padding-left: 0.15rem !important;
    padding-right: 0.15rem !important;
    text-align: center;
    vertical-align: middle;
}

.item-drag-handle {
    width: 30px;
    min-height: 32px;
    color: #756753;
}

.sortable-items tr[data-item-id] {
    touch-action: pan-y;
}

.sortable-ghost {
    opacity: 0.45;
    background: rgba(199, 91, 18, 0.12) !important;
}

@media (max-width: 768px) {
    .drag-handle {
        flex-basis: 40px;
        width: 40px;
        min-height: 42px;
    }

    .item-drag-cell {
        width: 42px;
        min-width: 42px;
    }

    .item-drag-handle {
        width: 40px;
        min-height: 40px;
    }

    .editor-gear-item {
        min-width: 0;
        padding-right: 0.35rem;
    }

    .editor-gear-item-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.editor-sidebar-empty,
.editor-sidebar-hint {
    color: #eadfc8;
    font-size: 0.78rem;
    padding: 0.45rem 0.55rem;
}

@media (max-width: 991.98px) {
    .navbar-mochileitor .dropdown {
        position: static;
    }

    .navbar-mochileitor .dropdown-menu {
        position: absolute;
        inset-inline-start: 0.5rem;
        inset-inline-end: 0.5rem;
        width: auto;
        max-width: calc(100vw - 1rem);
        transform: none !important;
        box-sizing: border-box;
    }
}

/* Editor de packs: comparte la estructura visual del editor de mochilas. */
.pack-edit-page .editor-shell {
    grid-template-columns: 285px minmax(0, 1fr);
}

.pack-edit-page .editor-sidebar {
    top: 0.5rem;
    height: calc(100vh - 1rem);
}

.pack-editor-catalog .editor-gear-list {
    max-height: calc(100vh - 330px);
}

.pack-items-scroll {
    max-height: calc(100vh - 230px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pack-edit-page .editor-stat {
    border: 1px solid rgba(46, 58, 31, 0.12);
    background: #fffdf8;
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
}

@media (max-width: 992px) {
    .pack-edit-page .editor-sidebar,
    .pack-items-scroll {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .pack-edit-page .editor-shell {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
    }

    .pack-edit-page .editor-sidebar,
    .pack-edit-page .editor-main {
        width: 100%;
    }

    .pack-edit-page .editor-sidebar {
        order: 0;
    }

    .pack-edit-page .editor-main {
        order: 1;
    }
}

@media (max-width: 767.98px) {
    .edit-page .editor-main,
    .edit-page .card,
    #items-container,
    .pack-items-scroll {
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    .items-table {
        width: 100%;
        table-layout: fixed;
    }

    .items-table tr[data-item-id] > td {
        min-width: 0;
    }

    .items-table .item-drag-cell {
        width: 42px !important;
    }

    .items-table .item-name-cell {
        width: auto !important;
        overflow: hidden;
    }

    .items-table .item-name-cell > .d-flex {
        min-width: 0;
    }

    .items-table .item-copy-name-input {
        min-width: 0;
        width: 100%;
    }

    .items-table .item-copy-name-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .items-table .item-quantity-cell {
        width: 76px !important;
    }

    .items-table .quantity-stepper {
        grid-template-columns: 26px 24px 26px;
    }

    .items-table .quantity-btn {
        width: 26px;
        height: 40px;
    }

    .items-table .item-weight-cell {
        width: 62px !important;
        white-space: nowrap;
    }

    .items-table .item-subtotal-cell,
    .items-table .item-secondary-actions,
    .items-table .item-notes-cell {
        display: none;
    }

    .items-table tr[data-item-source="pack"] .item-secondary-actions {
        display: table-cell;
        width: 32px !important;
        padding-left: 0.1rem;
        padding-right: 0.1rem;
    }

    .items-table tr[data-item-source="pack"] .item-secondary-actions > div {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.1rem;
    }

    .items-table tr[data-item-source="pack"] .item-pack-preview {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        min-height: 32px;
        padding: 0;
    }

    .items-table .item-delete-cell {
        width: 42px !important;
    }

    .items-table .item-delete-cell .btn {
        width: 40px;
        min-height: 40px;
    }

    .items-table tr[data-item-source="pack"] .item-delete-cell {
        width: 34px !important;
        padding-left: 0.1rem;
        padding-right: 0.1rem;
    }

    .items-table tr[data-item-source="pack"] .item-delete-cell .btn {
        width: 34px;
        min-height: 34px;
        padding: 0;
    }

    .pack-items-scroll .category-section > .row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        margin: 0;
    }

    .pack-items-scroll .category-section > .row > div:nth-child(1) {
        grid-column: 1 / -1;
    }

    .pack-items-scroll .category-section > .row > div:nth-child(2),
    .pack-items-scroll .category-section > .row > div:nth-child(4) {
        grid-column: 1;
    }

    .pack-items-scroll .category-section > .row > div:nth-child(3),
    .pack-items-scroll .category-section > .row > div:nth-child(6) {
        grid-column: 2;
        width: 82px;
    }

    .pack-items-scroll .category-section > .row > div:nth-child(5),
    .pack-items-scroll .category-section > .row + .small,
    .pack-items-scroll .category-section > .row > div:nth-child(6) .btn-outline-secondary {
        display: none;
    }

    .pack-items-scroll .category-section > .row > div:nth-child(6) .btn {
        min-width: 38px;
        min-height: 38px;
    }
}

.sidebar-drop-active {
    outline: 2px dashed #E07A38;
    outline-offset: 2px;
    background: rgba(199, 91, 18, 0.08);
}

.category-section {
    border: 1px solid rgba(46, 58, 31, 0.08);
    border-radius: 6px;
    overflow: hidden;
    background: #fffdf8;
}

.category-section-header {
    min-height: 36px;
    margin: 0 !important;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    background: linear-gradient(90deg, rgba(46, 58, 31, 0.11), rgba(232, 224, 209, 0.34));
    border-left: 4px solid #C75B12;
    border-bottom: 1px solid rgba(46, 58, 31, 0.12);
}

.category-section-title {
    color: #2E3A1F;
    letter-spacing: 0;
}

.sortable-empty-drop td {
    padding: 0.7rem 0.5rem;
    border-top: 0;
}

.sortable-empty-drop-inner {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(199, 91, 18, 0.4);
    border-radius: 6px;
    color: #8a7c63;
    background: rgba(255, 249, 236, 0.7);
    font-size: 0.8rem;
}

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

    .editor-sidebar {
        position: static;
        height: auto;
        max-height: 520px;
    }
}

/* Crear mochila */
.create-pack-back {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: #6f6659;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.create-pack-back:hover {
    color: #C75B12;
}

.create-pack-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.create-pack-heading-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #2E3A1F, #4A5C32);
    color: #E07A38;
    font-size: 1.55rem;
    box-shadow: 0 8px 18px rgba(46, 58, 31, 0.2);
}

.create-pack-kicker {
    color: #C75B12;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.create-pack-card {
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
}

.create-pack-cover-column,
.create-pack-form-column {
    min-height: 100%;
    padding: 1.75rem;
}

.create-pack-cover-column {
    border-right: 1px solid #eadfcf;
    background: linear-gradient(145deg, #fbf7ee, #f3ecdf);
}

.create-pack-section-label {
    margin-bottom: 0.5rem;
    color: #2E3A1F;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.create-pack-cover-frame {
    display: grid;
    min-height: 230px;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dfd0b7;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.create-pack-cover-preview {
    width: 100%;
    height: 230px;
    object-fit: contain;
    padding: 0.65rem;
}

.create-pack-form-column {
    padding: 2rem;
}

.create-pack-visibility {
    padding: 1rem 1.1rem;
    border: 1px solid #e1d5c3;
    border-radius: 10px;
    background: #fbf8f2;
}

.create-pack-visibility .form-check-input:checked {
    border-color: #4A5C32;
    background-color: #4A5C32;
}

.create-pack-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-top: 1px solid #eadfcf;
    background: #fffdf9;
}

@media (max-width: 991px) {
    .create-pack-cover-column {
        border-right: 0;
        border-bottom: 1px solid #eadfcf;
    }

    .create-pack-cover-frame {
        min-height: 190px;
    }

    .create-pack-cover-preview {
        height: 190px;
    }
}

@media (max-width: 576px) {
    .create-pack-heading-icon {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
        border-radius: 13px;
    }

    .create-pack-cover-column,
    .create-pack-form-column {
        padding: 1.25rem;
    }

    .create-pack-actions {
        padding: 1rem 1.25rem;
    }
}

/* Edicion inline de copias dentro de una mochila */
.item-copy-edit-btn {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    line-height: 1;
}

.item-copy-name-input {
    min-width: 150px;
}

.item-copy-quantity-input,
.item-copy-weight-input {
    min-width: 58px;
    padding-right: 0.25rem;
    padding-left: 0.35rem;
    text-align: right;
}

.item-copy-notes-input {
    min-width: 130px;
}

.item-copy-editing {
    background: #fff8e8 !important;
}

/* Estanteria personal */
.gear-library-page {
    max-width: 1680px;
}

.gear-library-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gear-library-kicker {
    color: #C75B12;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.gear-library-intro {
    max-width: 920px;
    font-size: 0.92rem;
}

.gear-library-card {
    overflow: hidden;
}

.gear-library-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(190px, 270px) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eadfcf;
    background: #fbf8f2;
}

.gear-library-count {
    color: #6f6659;
    font-size: 0.82rem;
    white-space: nowrap;
}

.gear-library-table {
    font-size: 0.79rem;
}

.gear-library-table th {
    padding: 0.55rem 0.45rem;
    color: #2E3A1F;
    background: #f1ede4;
    white-space: nowrap;
}

.gear-library-table td {
    max-width: 260px;
    padding: 0.42rem 0.45rem;
}

.gear-library-table .form-control-sm {
    min-width: 76px;
    font-size: 0.76rem;
}

.gear-library-url {
    max-width: 180px;
    color: #5f6f45;
}

.gear-library-flags {
    display: inline-flex;
    gap: 0.4rem;
    color: #C75B12;
}

.gear-row-editing {
    background: #fff8e8 !important;
}

@media (max-width: 768px) {
    .gear-library-heading {
        flex-direction: column;
    }

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