.search-layout {
    max-width: 1100px;
    margin: 0 auto;}
.search-box-section {
    position: relative;
    z-index: 100;}
.search-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
    height: 54px;}
.search-input-container {
    flex: 1;
    position: relative;}
#tag-input {
    width: 100%;
    height: 100%;
    padding: 0 25px;
    font-size: 1.05rem;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    outline: none;}
#tag-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);}
.btn-add-ship {
    height: 100%;
    padding: 0 25px;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);}
.btn-add-ship:hover {
    background-color: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);}
.autocomplete-items {
    display: none;
    position: absolute;
    border: 1px solid #e9ecef;
    z-index: 1000;
    left: 0;
    right: 0;
    top: calc(100% + 5px);
    background: white;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 8px 0;}
.autocomplete-items div {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s;}
.autocomplete-items div:hover {
    background-color: #f8f9fa;
    color: #0d6efd;}
.highlight {color: #0d6efd; font-weight: 600;}
.autocomplete-active {
    background-color: #e7f1ff !important;
    color: #0d6efd !important;}
.selected-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    min-height: 30px;}
.tag-badge {
    background-color: #f1f3f5;
    color: #495057;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dee2e6;}
.remove-tag, .tag-delete-btn {
    cursor: pointer;
    color: #dc3545 !important;
    background: none;
    border: none;
    padding: 0;
    margin-left: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;}
.remove-tag:hover, .tag-delete-btn:hover {
    color: #a52834 !important;
    transform: scale(1.2);}
.ship-results-list {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background-color: white;
    overflow: hidden;}
.ship-card {
    background: white;
    border: none;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 0;}
.ship-card:last-child {
    border-bottom: none;}
.ship-card-main {
    display: flex;
    height: 240px; 
    padding: 10px 0;}
.ship-info-primary {
    flex: 0 0 280px;
    padding: 15px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;}
.ship-name-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;}
.ship-name-row h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;}
.ship-actions-wrapper {
    position: relative;
    margin-left: auto;}
.btn-actions {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;}
.btn-actions:hover {color: #495057;}
.actions-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 80px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    z-index: 1001;
    overflow: hidden;}
.actions-dropdown.show {display: block;}
.actions-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 15px;
    text-align: left;
    border: none;
    background: none;
    font-size: 0.85rem;
    color: #495057;
    cursor: pointer;
    transition: background 0.15s;}
.actions-dropdown-item:hover {
    background: #f8f9fa;
    color: #0d6efd;}
.actions-dropdown-item.delete:hover {color: #dc3545;}
.ship-meta-group {
    display: flex;
    flex-direction: column;
    gap: 6px;}
.ship-detail {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;}
.ship-detail strong {
    color: #495057;
    width: 60px;
    display: inline-block;}
.ship-info-tags {
    flex: 1;
    padding: 20px;
    border-left: 1px dashed #eee;
    overflow: hidden;}
.ship-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;}
.mini-tag {
    font-size: 0.75rem;
    background: #f8f9fa;
    padding: 3px 10px;
    border-radius: 6px;
    color: #6c757d;
    border: 1px solid #eee;}
.tag-badge.edit-mode {
    border-color: #0d6efd;
    background: #fff;
    padding-right: 8px;}
.tag-delete-btn {
    display: none;}
.tag-badge.edit-mode .tag-delete-btn {display: flex;}
.inline-tag-input {
    border: 1px solid #0d6efd;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    width: 90px;
    outline: none;}
.ship-photo-slider {
    width: 320px;
    position: relative;
    background: #f8f9fa;
    overflow: hidden;}
.slider-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;}
.slider-img {
    flex: 0 0 100%;
    width: 320px;
    object-fit: cover;}
.slider-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    text-shadow: 0 0 4px rgba(0,0,0,0.5);}
.ship-photo-slider:hover .slider-nav {opacity: 0.7;}
.slider-nav:hover {opacity: 1 !important;}
.slider-prev {left: 0;}
.slider-next {right: 0;}
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    pointer-events: none;}
.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: 0.2s;}
.dot.active {
    background: #fff;
    transform: scale(1.4);}
.ship-card-expanded {
    display: none;
    border-top: 1px solid #eee;
    background: #fafafa;
    height: auto;
    min-height: 380px;}
.ship-card.is-expanded .ship-card-expanded {display: flex;}
.history-date-list {
    width: 180px;
    border-right: 1px solid #eee;
    overflow-y: auto;
    background: #fdfdfd;}
.history-date-item {
    padding: 12px 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
    border-left: 3px solid transparent;
    color: #6c757d;}
.history-date-item:hover {background: #f1f3f5;}
.history-date-item.active {
    background: #fff;
    color: #0d6efd;
    font-weight: 700;
    border-left-color: #0d6efd;}
.history-detail-view-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;}
.history-detail-view {
    flex: 1;
    padding: 0;
    display: block;
    overflow: visible;}
.history-layout-container {
    display: flex;
    height: 100%;
    gap: 0;}
.history-middle {
    flex: 1;
    display: flex;
    padding: 25px;
    gap: 25px;
    border-right: 1px dashed #eee;}
.history-mid-left, .history-mid-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;}
.history-side-right {
    flex: 0 0 320px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;}
.h-item label {
    font-size: 0.7rem;
    color: #adb5bd;
    font-weight: 700;
    margin-bottom: 2px; 
    display: block;}
.h-item span {
    font-size: 0.88rem;
    font-weight: 500;
    color: #343a40;
    white-space: pre-wrap;
    word-break: break-all;}
.highlight-text {
    color: #0d6efd !important;
    font-weight: 700 !important;}
.h-item-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100px;}
.scroll-box {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.82rem;
    color: #495057;
    overflow-y: auto;
    max-height: 100px;}
.path-img-container {
    width: 300px;
    height: 300px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    margin-bottom: 10px;}
.path-img {
    width: 100%;
    height: 100%;
    object-fit: fill;}
.path-text-display {
    width: 100%;
    margin-top: 15px;
    padding: 10px;
    font-size: 0.9rem;
    color: #495057;
    text-align: center;
    font-weight: 500;
    line-height: 1.5;}
.edit-row {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 2px !important;}
.edit-row label {
    width: 60px;
    font-size: 0.65rem;
    margin-bottom: 0;}
.edit-row input {
    flex: 1;
    padding: 2px 8px !important;
    font-size: 0.75rem !important;}
.btn-custom {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;}
.btn-edit {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;}
.btn-edit:hover {
    background: #e9ecef;
    color: #212529;}
.btn-save {
    background: #0d6efd;
    color: white;}
.btn-save:hover {background: #0b5ed7;}
.btn-outline-primary {
    border-color: #0d6efd;
    color: #0d6efd;
    background: transparent;}
.btn-outline-primary:hover {
    background: #0d6efd;
    color: white;}
.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
    background: transparent;}
.btn-outline-danger:hover {
    background: #dc3545;
    color: white;}
.history-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;}
.history-edit-form {display: contents;}
.edit-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;}
.edit-group input, .edit-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    background: white;}
.edit-group input:focus, .edit-group textarea:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.05);}
.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    background: white;
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.2s;}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: #0d6efd;
    background: #f0f7ff;}
.drop-zone span {
    font-size: 0.7rem;
    color: #adb5bd;
    display: block;
    margin-bottom: 5px;}
.drop-zone input {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.8rem;
    width: 100%;
    color: #495057;
    text-align: center;}
.history-path-box {
    width: 320px;
    padding: 25px;
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    border-left: 1px solid #eee;}
.pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;}
.page-btn {
    min-width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #eee;
    background: white;
    color: #adb5bd;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;}
.page-btn:hover:not(:disabled) {
    color: #0d6efd;
    border-color: #0d6efd;}
.page-btn.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;}
.fade-in {animation: fadeIn 0.3s ease;}
@keyframes fadeIn {
    from {opacity: 0;} to {opacity: 1;}}
.hidden { display: none !important; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.full-width { grid-column: span 2; }
.expand-btn {
    cursor: pointer;
    padding: 5px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;}
.expand-btn span {
    display: inline-block;
    transition: transform 0.3s ease;
    transform: rotate(0deg);
    font-size: 1rem;
    color: #adb5bd;}
.ship-card.is-expanded .expand-btn span {
    transform: rotate(180deg);
    color: #0d6efd;}