/* ── Toolbar & search ── */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 10px; gap: 16px; }
.title-search { display: flex; align-items: center; gap: 14px; }
.search-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #b7b7bd;
    border-radius: 999px;
    background: #f8f8f8;
    height: 40px;
    padding: 0 12px;
    width: 325px;
    max-width: 325px;
    flex: 0 0 325px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.search-pill:focus-within {
    border-color: #0c56b4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(12, 86, 180, .14);
}
.search-pill input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    width: 100%;
    color: #2d3443;
}
.search-pill input::placeholder { color: #808a9f; }
.search-pill span {
    font-size: 1.12rem;
    color: #5a5f6a;
    line-height: 1;
    flex: 0 0 auto;
}
.filter-btn { font-size: 1.05rem; font-weight: 700; color: #0a3f8f; border: none; border-radius: 999px; padding: 8px 14px; background: #e7e7ea; }

/* ── Shipments table ── */
.table-wrap { padding: 14px 14px 8px; overflow: auto; }
.ship-table { width: 100%; border-collapse: collapse; min-width: 1080px; }
.ship-table th, .ship-table td { padding: 12px 8px; font-size: .95rem; color: #1e1e1e; vertical-align: top; }
.ship-table th { font-weight: 700; color: #0a3f8f; white-space: nowrap; }
.ship-table thead tr { border-bottom: 1px solid #b9b9bf; }
.ship-table tbody tr + tr { border-top: 1px solid #e0e0e4; }
.ship-table tbody tr { cursor: pointer; }

.ship-pagination-summary {
    margin-top: 10px;
    color: #4b5f82;
    font-size: .86rem;
    text-align: center;
}

.ship-pagination {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 10px;
    gap: 10px;
    margin: 14px 0 4px;
}
.ship-pagination-controls {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 10px;
}
.ship-page-list {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ship-pagination-summary-inline {
    color: #4b5f82;
    font-size: .86rem;
    text-align: right;
    white-space: nowrap;
}
.ship-page-ellipsis {
    color: #7d8aa5;
    font-size: .9rem;
    font-weight: 700;
    padding: 0 2px;
}
.ship-page-btn,
.ship-page-number {
    border: 1px solid #c6cfdf;
    background: #fff;
    color: #20437e;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
}
.ship-page-number.is-active {
    background: #0c56b4;
    border-color: #0c56b4;
    color: #fff;
}
.ship-page-btn.is-disabled {
    color: #8b98b3;
    background: #f2f5fb;
    border-color: #d8dfed;
    pointer-events: none;
}

.status-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.badge-entregado { background: #d4edda; color: #1a5c2e; }
.badge-camino { background: #cfe2ff; color: #0a3f8f; }
.badge-pendiente { background: #fff3cd; color: #856404; }

.status-editor { position: relative; display: inline-block; }
.status-pill-toggle {
    margin-top: 6px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}
.status-pill-toggle.badge-entregado { background: #d4edda; color: #1a5c2e; border-color: #b7ddc2; }
.status-pill-toggle.badge-camino { background: #cfe2ff; color: #0a3f8f; border-color: #aac8f5; }
.status-pill-toggle.badge-pendiente { background: #fff3cd; color: #856404; border-color: #eedf9c; }

.status-pill-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 4000;
    width: max-content;
    max-width: calc(100vw - 16px);
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #d0d8e8;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(10, 26, 56, .15);
    display: none;
}
.status-editor.open .status-pill-menu { display: block; }

.status-change-form + .status-change-form { margin-top: 4px; }
.status-pill-option {
    width: auto;
    border: 1px solid transparent;
    background: #f4f8ff;
    color: #163f7a;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: .82rem;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
.status-pill-option:hover { background: #e6f0ff; }
.status-pill-option.is-active {
    background: #eef1f6;
    color: #8a94a8;
    cursor: default;
}

/* ── Filter panel ── */
.filter-overlay { position: fixed; inset: 0; background: rgba(10, 26, 56, .15); z-index: 100; display: none; }
.filter-panel { position: fixed; top: 0; right: 0; width: 340px; height: 100vh; background: #f7f7f8; border-left: 1px solid #d1d1d4; box-shadow: -20px 0 40px rgba(10,26,56,.14); z-index: 101; transform: translateX(100%); transition: transform .25s ease; }
.filter-panel.open { transform: translateX(0); }
.filter-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 14px; border-bottom: 1px solid #d7d7dc; }
.filter-head h2 { margin: 0; font-size: 1.5rem; color: #0a3f8f; }
.filter-close { background: none; border: none; font-size: 1.6rem; color: #0a3f8f; }
.filter-group { padding: 14px 22px; border-bottom: 1px solid #d7d7dc; }
.filter-group h3 { margin: 0 0 10px; font-size: 1rem; color: #0a3f8f; }
.filter-select { width: 100%; border: 1px solid #bcbfc8; border-radius: 12px; background: #fff; font-size: .95rem; color: #243454; padding: 10px 12px; }
.filter-actions { padding: 18px 22px; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid #d7d7dc; }
.btn-chip { border: none; border-radius: 999px; padding: 10px 18px; font-size: .95rem; font-weight: 700; color: #fff; }
.btn-clear { background: #f24a8f; }
.btn-save { background: #144da8; }

/* ── Detail modal ── */
.screen-dimmer { position: fixed; inset: 0; background: rgba(4, 17, 39, 0.55); z-index: 200; display: none; }
.detail-modal {
    position: fixed;
    top: 74px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1130px, calc(100vw - 64px));
    max-height: calc(100vh - 92px);
    background: #f1f1f2;
    border: 1px solid #d0d0d4;
    border-radius: 4px;
    z-index: 201;
    box-shadow: 0 14px 36px rgba(0,0,0,.22);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.detail-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid #c6c6cb; padding: 0 24px; }
.detail-tab {
    padding: 18px 8px 10px;
    text-align: center;
    font-size: 1.55rem;
    font-weight: 500;
    color: #1f1f1f;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 4px solid transparent;
}
.detail-tab.active { color: #0c4fa7; border-bottom-color: #0c4fa7; }
.tab-panel { display: none; padding: 24px 36px 28px; min-height: 390px; }
.tab-panel.active { display: block; }
.detail-footer { border-top: 1px solid #d2d2d6; background: #efeff1; padding: 12px 20px; display: flex; justify-content: flex-end; }
.modal-close-btn { border: none; border-radius: 999px; background: #0c4fa7; color: #fff; padding: 8px 18px; font-size: .95rem; font-weight: 700; }

/* ── Tracking tab ── */
.track-flow { margin: 50px 24px 10px; position: relative; }
.track-line { position: absolute; top: 14px; left: 84px; right: 84px; height: 4px; background: #0aad4a; }
.track-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; position: relative; z-index: 2; }
.track-step { text-align: center; color: #1f1f1f; }
.track-dot { width: 26px; height: 26px; border-radius: 50%; background: #0aad4a; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.track-step b { display: block; font-size: 1.16rem; line-height: 1.15; font-weight: 500; }
.track-step span { display: block; font-size: .98rem; line-height: 1.15; color: #2f2f2f; }
.public-link-wrap { text-align: center; margin-top: 84px; }
.public-link-wrap .title { font-size: 1.15rem; margin-bottom: 30px; color: #222; }
.public-link-row { display: inline-flex; align-items: center; gap: 16px; border-bottom: 1px solid #9c9ca2; padding: 0 2px 8px; min-width: 380px; }
.public-link-row a { color: #0d4fa7; font-size: .98rem; }
.public-link-row .link-ico { color: #0d4fa7; font-size: 1.28rem; font-weight: 700; }

/* ── Observations & assignments tabs ── */
.modal-table-wrap { margin: 8px 56px 0; border: 1px solid #d5d5d9; border-radius: 12px; background: #f7f7f8; overflow: hidden; }
.modal-table { width: 100%; border-collapse: collapse; }
.modal-table thead th { background: #dddddf; color: #222; font-size: 1.02rem; font-weight: 600; text-align: left; padding: 12px 14px; }
.modal-table tbody td { color: #1f1f1f; font-size: 1.02rem; padding: 14px; border-top: 1px solid #e4e4e8; vertical-align: top; }
.modal-table tbody tr:first-child td { border-top: none; }
.obs-photo-thumb {
    width: 168px; height: 112px; margin: 12px 0 0; border-radius: 2px; border: 1px solid #ddd;
    background: linear-gradient(135deg, #d9e1ea 0%, #f5d8bf 50%, #cfd8c7 100%);
    display: flex; align-items: center; justify-content: center; font-size: 1.08rem; color: #fff; font-weight: 700;
}
.obs-actions { display: flex; justify-content: center; gap: 42px; margin-top: 26px; }
.obs-btn { border: none; background: #0c4fa7; color: #fff; border-radius: 999px; min-width: 236px; height: 46px; padding: 0 24px; font-size: 1.06rem; font-weight: 600; }
.assign-wrap { margin: 8px 56px 0; }

/* ── Detail tab ── */
.detail-grid { margin-top: 6px; display: grid; grid-template-columns: 1fr 220px; gap: 18px; align-items: start; }
.detail-fields { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 16px 12px; align-items: end; }
.d-field { border-bottom: 1px solid #8e8e94; padding-bottom: 5px; }
.d-field b { display: block; color: #1d1d1f; font-size: .95rem; font-weight: 600; margin-bottom: 4px; }
.d-field span { display: block; color: #26262a; font-size: .95rem; line-height: 1.2; }
.d-field.wide { grid-column: span 5; }
.d-field.half { grid-column: span 3; }
.qr-box-wrap { margin-top: 46px; display: flex; justify-content: center; }
.fake-qr {
    width: 160px; height: 160px; border: 1px solid #444;
    background:
        linear-gradient(90deg, #000 10%, transparent 10%, transparent 20%, #000 20%, #000 30%, transparent 30%, transparent 40%, #000 40%, #000 50%, transparent 50%, transparent 60%, #000 60%, #000 70%, transparent 70%, transparent 80%, #000 80%, #000 90%, transparent 90%),
        linear-gradient(#000 10%, transparent 10%, transparent 20%, #000 20%, #000 30%, transparent 30%, transparent 40%, #000 40%, #000 50%, transparent 50%, transparent 60%, #000 60%, #000 70%, transparent 70%, transparent 80%, #000 80%, #000 90%, transparent 90%);
    background-size: 20px 20px;
    position: relative; overflow: hidden;
}
.fake-qr::before,
.fake-qr::after { content: ""; position: absolute; width: 42px; height: 42px; border: 6px solid #000; background: #fff; }
.fake-qr::before { top: 8px; left: 8px; }
.fake-qr::after { top: 8px; right: 8px; }
.fake-qr i { position: absolute; bottom: 8px; left: 8px; width: 42px; height: 42px; border: 6px solid #000; background: #fff; }
