.package1-history-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.package1-history-modal[hidden] {
    display: none;
}

.package1-history-modal-box {
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    background: #ffffff;
    border: 1px solid #ece3ff;
    border-radius: 24px;
    box-shadow: 0 20px 46px rgba(91, 33, 182, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.package1-history-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #f1ebff;
    background: #ffffff;
}

.package1-history-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #2e1065;
}

.package1-history-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.package1-history-close:hover {
    background: #ede9fe;
}

.package1-history-modal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.package1-history-summary {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid #f1ebff;
    border-radius: 18px;
    background: #fcfbff;
}

.package1-history-summary-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.package1-history-summary-row strong {
    font-size: 0.82rem;
    color: #4c1d95;
    font-weight: 900;
}

.package1-history-summary-row span {
    font-size: 0.92rem;
    color: #1f2937;
    font-weight: 500;
}

.package1-history-list {
    display: grid;
    gap: 12px;
}

/* History item rendered by details_modal.js */
.package1-history-item {
    border: 1px solid #eee7ff;
    border-radius: 18px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(91, 33, 182, 0.06);
}

.package1-history-item-header {
    padding: 12px 14px 0;
}

.package1-history-date {
    display: inline-flex;
    align-items: center;
    font-size: 0.84rem;
    font-weight: 900;
    color: #4c1d95;
}

.package1-history-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px 12px;
    border-bottom: 1px solid #f1ebff;
}

.package1-history-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.2;
    border: 1px solid transparent;
}

.package1-history-arrow {
    color: #7c3aed;
    font-weight: 900;
    font-size: 0.95rem;
}

.package1-history-status-completed {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.package1-history-status-progress {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde68a;
}

.package1-history-status-action {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.package1-history-status-empty {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.package1-history-comments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
}

.package1-history-comment-box {
    min-height: 92px;
    padding: 13px;
    border: 1px solid #eee7ff;
    border-radius: 14px;
    background: #fcfbff;
}

.package1-history-comment-box strong {
    display: block;
    margin-bottom: 8px;
    color: #4c1d95;
    font-size: 0.8rem;
    font-weight: 900;
}

.package1-history-comment-box p {
    margin: 0;
    color: #374151;
    font-size: 0.88rem;
    line-height: 1.55;
    font-weight: 500;
    word-break: break-word;
}

/* Keep old card class support if any older markup still exists */
.package1-history-card {
    border: 1px solid #eee7ff;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
}

.package1-history-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: #faf7ff;
    border-bottom: 1px solid #f1ebff;
}

.package1-history-status-change {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.package1-history-status-arrow {
    color: #7c3aed;
    font-weight: 700;
    font-size: 0.9rem;
}

.package1-history-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
}

.package1-history-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.package1-history-block-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: #4c1d95;
}

.package1-history-block .package1-history-comment-box {
    white-space: pre-wrap;
}

.package1-history-empty {
    padding: 18px;
    border: 1px dashed #d8c7ff;
    border-radius: 16px;
    background: #fcfbff;
    color: #6b7280;
    text-align: center;
    font-weight: 700;
}