/* ===================== MODAL ===================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(4px);
    z-index: 200;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 550px;
    max-width: 95vw;
    max-height: 80vh;
    overflow-y: auto;
    animation: fadeSlideIn .25s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.modal-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title i {
    color: var(--primary-500);
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 20px 24px;
}

.modal-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--gray-50);
}

.modal-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
}

.modal-value {
    font-size: 13px;
    color: var(--gray-800);
    word-break: break-word;
}

.modal-divider {
    padding: 14px 0 8px;
    border-top: 2px solid var(--primary-100);
    margin-top: 6px;
}

.modal-divider-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-600);
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-divider-text i {
    font-size: 13px;
}

/* ===================== EMPTY / LOADING ===================== */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.empty {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 40px;
    color: var(--gray-300);
    margin-bottom: 12px;
}

.empty-icon i {
    font-size: 40px;
}

.empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
}

/* ===================== TOAST ===================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    border-left: 4px solid var(--gray-300);
    animation: toastIn .3s ease, toastOut .3s ease 4s forwards;
    min-width: 280px;
}

.toast i {
    font-size: 16px;
}

.toast.success {
    border-color: var(--emerald-500);
}

.toast.success i {
    color: var(--emerald-500);
}

.toast.error {
    border-color: var(--rose-500);
}

.toast.error i {
    color: var(--rose-500);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ===================== CHECKBOX ===================== */
.draft-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-600);
    cursor: pointer;
}

.select-all-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--primary-50);
    border-bottom: 1px solid var(--primary-100);
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
}

.select-all-bar label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* ===================== DRAFT TABS ===================== */
.draft-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-100);
    padding: 0 20px;
    background: var(--gray-50);
    position: relative;
    z-index: 10;
}

.draft-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
    font-family: inherit;
}

.draft-tab:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.draft-tab.active {
    color: var(--primary-700);
    border-bottom-color: var(--primary-600);
}

.draft-tab i {
    font-size: 12px;
}

.draft-tab-count {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.draft-tab.active .draft-tab-count {
    background: var(--primary-500);
    color: white;
}

/* ===================== NEW ORDERS BAR ===================== */
.new-orders-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    border-bottom: 1px solid var(--primary-200);
    color: var(--primary-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
    animation: slideDownFade .3s ease;
}

.new-orders-bar:hover {
    background: linear-gradient(135deg, #E0E7FF, #C7D2FE);
}

.new-orders-bar i {
    color: var(--primary-500);
    animation: bellRing 1s ease infinite;
}

@keyframes bellRing {

    0%,
    100% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(12deg);
    }

    30% {
        transform: rotate(-12deg);
    }

    45% {
        transform: rotate(6deg);
    }

    60% {
        transform: rotate(0);
    }
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0 20px;
    }

    to {
        opacity: 1;
        max-height: 60px;
        padding: 10px 20px;
    }
}

/* ===================== RESIZABLE COLUMNS ===================== */
.draft-table thead th {
    position: relative;
    user-select: none;
}

.draft-table thead th:not(.th-no-resize)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 3px;
    background: var(--primary-300);
    cursor: col-resize;
    opacity: 0;
    transition: opacity .2s;
    border-radius: 2px;
}

.draft-table thead th:not(.th-no-resize):hover::after {
    opacity: 1;
}

/* ===================== ROW SELECTION ===================== */
.draft-table tbody tr.row-selected {
    background: var(--primary-50) !important;
    outline: 1px solid var(--primary-200);
}

.draft-table tbody tr.row-selected td {
    color: var(--primary-800);
}

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn .2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp .25s ease;
}

.modal-content.modal-lg {
    max-width: 1100px;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.modal-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title i {
    color: var(--primary-500);
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all .15s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.export-preview-info {
    padding: 10px 14px;
    background: var(--emerald-50);
    border-radius: var(--radius-sm);
    color: var(--emerald-700);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive rules moved to end of file */

