/* Migo Print Workflow — Customer Re-upload Form & Order Notices */

/* ── Order notice banners ─────────────────────────────────────────────── */
.migo-order-notice {
    margin: 24px 0;
    padding: 16px 20px;
    border-radius: 6px;
    border-left: 4px solid transparent;
}
.migo-notice-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}
.migo-notice-body {
    font-size: 14px;
    line-height: 1.7;
}
.migo-order-notice--info {
    background: #e8f4ff;
    border-color: #70a8e0;
    color: #003d7a;
}
.migo-order-notice--warning {
    background: #fff8e6;
    border-color: #f0c050;
    color: #5a4000;
}
.migo-order-notice--success {
    background: #edfff0;
    border-color: #70c070;
    color: #1a5c00;
}
.migo-order-notice--error {
    background: #fff0f0;
    border-color: #f09090;
    color: #7a0000;
}

/* ── Re-upload section wrapper ────────────────────────────────────────── */
.migo-reupload-section {
    margin: 32px 0 16px;
    padding: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}
.migo-reupload-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a1a1a;
}
.migo-reupload-desc {
    font-size: 14px;
    color: #555;
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ── Upload fields ────────────────────────────────────────────────────── */
.migo-reupload-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.migo-upload-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.migo-upload-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 4px;
}
.migo-required {
    color: #c8102e;
    font-size: 14px;
}

/* ── Upload area (drop zone) ──────────────────────────────────────────── */
.migo-upload-area {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    min-height: 100px;
}
.migo-upload-area:hover,
.migo-upload-area.migo-drag-over {
    border-color: #c8102e;
    background: #fff5f5;
}
.migo-upload-area.migo-has-file {
    border-color: #3B6D11;
    background: #f0fff4;
    border-style: solid;
}
.migo-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* ── Drop zone placeholder ────────────────────────────────────────────── */
.migo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    gap: 8px;
    pointer-events: none;
}
.migo-upload-icon {
    color: #aaa;
    display: flex;
}
.migo-upload-text {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    text-align: center;
}
.migo-upload-hint {
    font-size: 12px;
    color: #999;
    text-align: center;
}

/* ── Selected file preview ────────────────────────────────────────────── */
.migo-file-selected {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
}
.migo-file-ext {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #e8f0e8;
    color: #1a5c00;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .5px;
}
.migo-file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.migo-file-name-preview {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.migo-file-size {
    font-size: 12px;
    color: #888;
}
.migo-change-link {
    font-size: 12px;
    color: #c8102e;
    text-decoration: underline;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Submit button ────────────────────────────────────────────────────── */
.migo-submit-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: #c8102e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, opacity 0.2s;
    font-family: inherit;
    letter-spacing: .2px;
    margin-top: 4px;
}
.migo-submit-btn:hover:not(:disabled) {
    background: #a00c24;
}
.migo-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Orders list status badge ─────────────────────────────────────────── */
.migo-reupload-badge {
    display: inline-block;
    background: #fff0f0;
    color: #7a0000;
    border: 1px solid #f09090;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: .3px;
    animation: migo-pulse 2s ease-in-out infinite;
}
@keyframes migo-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .65; }
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .migo-reupload-section { padding: 16px; }
    .migo-file-selected { padding: 12px; gap: 10px; }
}

/* ── Per-item re-upload blocks ────────────────────────── */
.migo-reupload-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}
.migo-reupload-item-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: #f6f7f7;
    border-bottom: 1px solid #e0e0e0;
}
.migo-reupload-item-name { font-weight: 700; font-size: 14px; color: #1a1a1a; }
.migo-item-status-badge {
    font-size: 11px; font-weight: 600; padding: 2px 10px;
    border-radius: 20px; border: 1px solid;
}
.migo-item-status--rejected { background: #fff0f0; color: #7a0000; border-color: #f09090; }
.migo-item-status--ok       { background: #edfff0; color: #1a5c00; border-color: #70c070; }

.migo-rejection-reason {
    margin: 12px 16px;
    padding: 12px 14px;
    background: #fff8e6;
    border-left: 3px solid #f0c050;
    border-radius: 0 4px 4px 0;
}
.migo-rejection-reason-label { font-size: 12px; font-weight: 700; color: #7a5800; margin-bottom: 6px; }
.migo-rejection-reason-text  { font-size: 13px; color: #5a4000; line-height: 1.6; }

.migo-item--rejected .migo-upload-field { padding: 0 16px 16px; }
.migo-item--ok { opacity: .75; }

.migo-upload-prev-file {
    font-size: 11px; color: #aaa; margin-top: 4px;
    font-style: italic;
}

/* Approved file (no re-upload needed) */
.migo-file-approved {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: #f0fff4;
    border-top: 1px solid #d0ead0;
}
.migo-file-approved-icon {
    width: 10px; height: 10px; border-radius: 50%;
    background: #3B6D11; flex-shrink: 0;
}
.migo-file-approved-text { display: flex; flex-direction: column; gap: 2px; }
.migo-file-approved-label { font-size: 12px; font-weight: 600; color: #1a5c00; }
.migo-file-approved-name  { font-size: 11px; color: #4a8a4a; }

/* ── Option blocks (A/B) ──────────────────────────────── */
.migo-upload-label-row {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.migo-option-block {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: opacity .2s, border-color .2s;
}
.migo-option-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: #f9f9f9;
    border-bottom: 1px solid #e8e8e8;
}
.migo-option-badge {
    font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 20px; letter-spacing: .4px;
}
.migo-option-badge--upload { background: #e8f4ff; color: #003d7a; }
.migo-option-badge--keep   { background: #fff8e6; color: #7a5800; }
.migo-option-title { font-size: 13px; font-weight: 600; color: #1a1a1a; }

.migo-option-divider {
    display: flex; align-items: center;
    margin: 8px 0; gap: 10px; color: #bbb; font-size: 12px;
}
.migo-option-divider::before,
.migo-option-divider::after {
    content: ''; flex: 1;
    border-top: 1px solid #e8e8e8;
}

.migo-option--disabled { opacity: .4; pointer-events: none; }
.migo-option--selected { border-color: #3B6D11; }

/* Upload area inside option A */
.migo-option-upload .migo-upload-area { border: none; border-radius: 0; }
.migo-option-upload .migo-upload-area:hover,
.migo-option-upload .migo-upload-area.migo-drag-over { background: #f0f8ff; }

/* ── Keep-as-is button (Option B) ────────────────────── */
button.migo-keep-btn,
.migo-keep-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 14px 16px !important;
    background: #c8102e !important;
    background-color: #c8102e !important;
    border: none !important;
    border-radius: 0 0 6px 6px !important;
    cursor: pointer !important;
    font-family: inherit !important;
    text-align: left !important;
    transition: background .15s !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: normal !important;
    letter-spacing: normal !important;
}
button.migo-keep-btn:hover,
.migo-keep-btn:hover { background: #a00c24 !important; background-color: #a00c24 !important; }

button.migo-keep-btn svg,
.migo-keep-btn svg {
    color: #fff !important;
    stroke: #fff !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    flex-shrink: 0 !important;
    display: block !important;
}
button.migo-keep-btn .migo-keep-btn-content,
.migo-keep-btn .migo-keep-btn-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    flex: 1 !important;
    min-width: 0 !important;
}
button.migo-keep-btn .migo-keep-btn-title,
.migo-keep-btn .migo-keep-btn-title {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #fff !important;
    line-height: 1.3 !important;
    white-space: normal !important;
}
button.migo-keep-btn .migo-keep-btn-sub,
.migo-keep-btn .migo-keep-btn-sub,
.migo-keep-btn-sub {
    display: block !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: rgba(255,255,255,0.85) !important;
    line-height: 1.3 !important;
}

/* ── Keep accepted state ──────────────────────────────── */
.migo-keep-accepted {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; background: #f0fff4;
}
.migo-keep-accepted-icon {
    width: 18px; height: 18px; border-radius: 50%;
    background: #3B6D11; flex-shrink: 0; margin-top: 2px;
    position: relative;
}
.migo-keep-accepted-icon::after {
    content: ''; position: absolute;
    left: 5px; top: 3px;
    width: 5px; height: 8px;
    border: 2px solid #fff;
    border-top: none; border-left: none;
    transform: rotate(40deg);
}
.migo-keep-accepted-text {
    display: flex; flex-direction: column; gap: 4px;
}
.migo-keep-accepted-text strong { font-size: 13px; color: #1a5c00; }
.migo-keep-accepted-text span   { font-size: 12px; color: #4a8a4a; }
.migo-undo-keep {
    background: none; border: none; padding: 0;
    color: #c8102e; text-decoration: underline;
    font-size: 12px; cursor: pointer; font-family: inherit;
}
.migo-undo-keep:hover { color: #a00c24; }

/* ── Waiver modal ─────────────────────────────────────── */
.migo-modal-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.migo-modal-box {
    background: #fff; border-radius: 10px;
    max-width: 540px; width: 100%;
    padding: 28px; max-height: 90vh; overflow-y: auto;
}
.migo-modal-title {
    font-size: 18px; font-weight: 700; color: #1a1a1a;
    margin: 0 0 16px;
}
.migo-modal-body {
    font-size: 13px; line-height: 1.6; color: #444;
    background: #fff8e6; border: 1px solid #f0c050;
    border-radius: 6px; padding: 16px; margin-bottom: 18px;
    white-space: normal;
}
.migo-modal-body br + br { display: none; }
.migo-modal-check {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; color: #1a1a1a; line-height: 1.5;
    margin-bottom: 20px; cursor: pointer;
}
.migo-modal-check input { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; accent-color: #c8102e; }
.migo-modal-actions { display: flex; flex-direction: column; gap: 8px; }
.migo-modal-btn {
    width: 100%; padding: 12px 16px; border-radius: 6px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: inherit; border: none; transition: opacity .15s, background .15s;
}
.migo-modal-btn--cancel {
    background: #f5f5f5; color: #444;
    border: 1px solid #ddd;
}
.migo-modal-btn--cancel:hover { background: #eee; }
.migo-modal-btn--accept {
    background: #c8102e; color: #fff;
}
.migo-modal-btn--accept:hover:not(:disabled) { background: #a00c24; }
.migo-modal-btn--accept:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 600px) {
    .migo-modal-box { padding: 20px; }
    .migo-modal-actions { flex-direction: column; }
}

/* ── Waiver hint (FIX #3) ─────────────────────────────── */
.migo-waiver-hint {
    font-size: 12px; color: #c8102e; font-weight: 500;
    background: #fff0f0; border: 1px solid #f09090;
    border-radius: 4px; padding: 8px 12px; margin-bottom: 12px;
}
@keyframes migo-shake {
    0%,100%{ transform: translateX(0); }
    20%    { transform: translateX(-6px); }
    40%    { transform: translateX(6px); }
    60%    { transform: translateX(-4px); }
    80%    { transform: translateX(4px); }
}
.migo-shake { animation: migo-shake .4s ease; }

/* ── Current files section (FIX #5) ──────────────────── */
.migo-current-files-section {
    margin: 0 0 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px; overflow: hidden;
    background: #fafafa;
}
.migo-current-files-title {
    font-size: 13px; font-weight: 700;
    padding: 10px 16px; margin: 0;
    background: #f0f0f0;
    border-bottom: 1px solid #e0e0e0;
    color: #1a1a1a;
}
.migo-current-files-item { padding: 10px 16px; border-bottom: 1px solid #f0f0f0; }
.migo-current-files-item:last-child { border-bottom: none; }
.migo-current-files-item-name {
    font-size: 13px; font-weight: 600; color: #1a1a1a; margin-bottom: 8px;
}
.migo-current-file-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px; border-radius: 4px;
    margin-bottom: 4px; background: #fff;
    border: 1px solid #eee;
}
.migo-cf--new  { border-color: #70a8e0; background: #f0f8ff; }
.migo-cf--kept { border-color: #f0c050; background: #fffbf0; }
.migo-cf-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.migo-cf-label { font-size: 11px; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: .3px; }
.migo-cf-name  { font-size: 12px; color: #1a1a1a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.migo-cf-badge {
    font-size: 10px; font-weight: 600; padding: 2px 8px;
    border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.migo-cf-badge--new  { background: #e8f4ff; color: #003d7a; border: 1px solid #70a8e0; }
.migo-cf-badge--kept { background: #fff8e6; color: #7a5800; border: 1px solid #f0c050; }
.migo-cf-link {
    font-size: 12px; color: #c8102e; text-decoration: none;
    white-space: nowrap; flex-shrink: 0; font-weight: 500;
}
.migo-cf-link:hover { text-decoration: underline; }

/* ── C3: History log inside rejection banner ──────────── */
.migo-notice-current-rejection {
    font-size: 13px; line-height: 1.6;
    margin-bottom: 6px; color: #5a4000;
}
.migo-notice-item-name { font-weight: 700; }

.migo-history-log {
    margin-top: 14px;
    border-top: 1px solid #f0c050;
    padding-top: 12px;
    display: flex; flex-direction: column; gap: 14px;
}
.migo-log-product {}
.migo-log-product-name {
    font-size: 12px; font-weight: 700; color: #7a5800;
    text-transform: uppercase; letter-spacing: .4px;
    margin-bottom: 6px;
}
.migo-log-entry {
    display: flex; align-items: baseline; flex-wrap: wrap;
    gap: 5px; padding: 5px 0;
    border-bottom: 1px solid rgba(240,192,80,.3);
    font-size: 12px; line-height: 1.5;
}
.migo-log-entry:last-child { border-bottom: none; }

.migo-log-date  { color: #999; white-space: nowrap; flex-shrink: 0; }
.migo-log-actor { font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.migo-log-text  { color: #5a4000; flex: 1; min-width: 0; }
.migo-log-file-link {
    font-size: 11px; color: #2271b1; text-decoration: none;
    white-space: nowrap; flex-shrink: 0;
    padding: 1px 6px; background: rgba(34,113,177,.08);
    border-radius: 3px;
}
.migo-log-file-link:hover { text-decoration: underline; }

.migo-log-entry--reject .migo-log-actor { color: #A32D2D; }
.migo-log-entry--reject .migo-log-text  { color: #7a0000; }
.migo-log-entry--upload .migo-log-actor { color: #185FA5; }
.migo-log-entry--upload .migo-log-text  { color: #003d7a; }
.migo-log-entry--keep   .migo-log-actor { color: #854F0B; }
.migo-log-entry--keep   .migo-log-text  { color: #7a5800; }

/* ── C2: Option B — already handled in .migo-keep-btn above ── */

/* ── C4: Progress bar ────────────────────────────────── */
.migo-upload-progress {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; background: #f0f8ff;
    border-top: 1px solid #c8e0f4;
}
.migo-upload-progress-bar {
    flex: 1; height: 6px; background: #ddd;
    border-radius: 3px; overflow: hidden;
    position: relative;
}
.migo-upload-progress-bar::after {
    content: '';
    position: absolute; inset: 0;
    background: #2271b1;
    width: 0%; transition: width .2s ease;
}
.migo-upload-progress-pct {
    font-size: 12px; font-weight: 600; color: #2271b1;
    min-width: 36px; text-align: right;
}

/* ── C4: Image thumbnail preview ─────────────────────── */
.migo-file-thumb-wrap {
    width: 80px; height: 80px; border-radius: 6px;
    overflow: hidden; background: #f0f0f0;
    flex-shrink: 0; border: 1px solid #ddd;
    display: flex; align-items: center; justify-content: center;
}
.migo-file-thumb {
    width: 100%; height: 100%; object-fit: cover;
}
.migo-file-ext--pdf  { background: #fae8e6; color: #c0392b; }
.migo-file-ext--ai,
.migo-file-ext--eps,
.migo-file-ext--psd  { background: #f0eeff; color: #534AB7; }
.migo-log-sep { color: #ccc; font-size: 11px; flex-shrink: 0; }
