.thumb { width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid #dee2e6; border-radius: 4px; }
.thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 11px; color: #6c757d; }
.url-cell { max-width: 380px; }
tr.row-clickable { cursor: pointer; }
tr.pv-current > td { background: #e7f1ff; }

/* ---------- Preview modal ---------- */
.preview-modal .modal-content { background: #111827; color: #e5e7eb; border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.pv-header { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.pv-title { flex: 1; min-width: 0; }
.pv-title > * { display: block; }
.pv-title a { color: #93c5fd; text-decoration: none; }
.pv-title a:hover { text-decoration: underline; }
.pv-counter { background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pv-stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px 70px 24px; background: radial-gradient(ellipse at top, #1f2937, #111827 70%); transition: opacity .15s; }
.pv-stage.pv-loading { opacity: .55; }
.pv-stage.pv-bump { animation: pv-bump .3s; }
@keyframes pv-bump { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pv-pane { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.pv-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; }
.pv-label b { color: #fff; }
.pv-label span { color: #6b7280; letter-spacing: 0; margin-left: 4px; }
.pv-frame { position: relative; line-height: 0; cursor: crosshair; }
.pv-frame img { display: block; background: #fff; border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); user-select: none; }
.pv-lens { position: absolute; display: none; border-radius: 50%; border: 3px solid #fff; background-color: #fff; background-repeat: no-repeat;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .55); pointer-events: none; z-index: 5; }
.pv-empty { line-height: 1.5; color: #6b7280; padding: 120px 40px; border: 1px dashed #374151; border-radius: 10px; }

.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; width: 46px; height: 46px; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .1); color: #fff; font-size: 30px; line-height: 1; padding-bottom: 4px; transition: background .15s; }
.pv-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .25); }
.pv-nav:disabled { opacity: .2; }
.pv-prev { left: 14px; }
.pv-next { right: 14px; }

.pv-versions { display: flex; gap: 10px; padding: 12px 20px; overflow-x: auto; border-top: 1px solid rgba(255, 255, 255, .08); }
.pv-ver { flex: 0 0 auto; display: flex; gap: 10px; align-items: center; max-width: 260px; padding: 6px 12px 6px 6px; text-align: left; color: inherit;
    background: rgba(255, 255, 255, .05); border: 1px solid transparent; border-radius: 10px; font-size: 13px; line-height: 1.3; }
.pv-ver:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.pv-ver.active { border-color: #3b82f6; background: rgba(59, 130, 246, .18); }
.pv-ver.failed { opacity: .5; }
.pv-ver img, .pv-ver-x { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 6px; background: #fff; object-fit: contain; }
.pv-ver-x { display: flex; align-items: center; justify-content: center; background: #7f1d1d; color: #fff; font-size: 22px; }
.pv-ver small { display: block; max-width: 190px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #9ca3af; }

.pv-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 20px; background: #0b1220; font-size: 13px; color: #9ca3af; }
.pv-footer kbd { background: #374151; color: #e5e7eb; }
.pv-footer b { color: #e5e7eb; }
.pv-footer label { cursor: pointer; }

@media (max-width: 768px) {
    .pv-stage { grid-template-columns: 1fr; padding: 16px 56px; }
}

/* ---------- Row busy state ---------- */
.thumb-busy { position: relative; width: 72px; height: 72px; }
.thumb-busy .thumb { opacity: .35; }
.thumb-busy .spinner-border { position: absolute; top: 50%; left: 50%; margin: -.5rem 0 0 -.5rem; color: #0d6efd; }

/* ---------- Regenerate modal ---------- */
.regen-modal .modal-dialog { max-width: 620px; }
.regen-modal .modal-content { border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 64px rgba(15, 23, 42, .28); }
.rg-header { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid #eef0f3; background: linear-gradient(180deg, #f8fafc, #fff); }
.rg-header .btn-close { align-self: flex-start; }
.rg-thumb { flex: 0 0 60px; width: 60px; height: 60px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; overflow: hidden; }
.rg-thumb img { width: 100%; height: 100%; object-fit: contain; }
.rg-head-text { flex: 1; min-width: 0; }
.rg-kicker { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #0d6efd; }
.rg-name { font-size: 16px; font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-sub { font-size: 12.5px; color: #6b7280; }

.rg-body { display: flex; flex-direction: column; gap: 22px; padding: 20px 22px; }
.rg-label { display: inline-block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: #111827; }
.rg-opt { margin-left: 4px; font-size: 12px; font-weight: 400; color: #9ca3af; }
.rg-help { margin: 0 0 10px; font-size: 12.5px; color: #6b7280; }
.rg-link { font-size: 13px; text-decoration: none; }
.rg-link:hover { text-decoration: underline; }
.regen-modal textarea { resize: vertical; border-radius: 10px; font-size: 14px; }
.regen-modal textarea:focus, .regen-modal input:focus { border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .12); }

.rg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rg-chip { padding: 3px 12px; font-size: 12.5px; color: #374151; background: #fff; border: 1px solid #e5e7eb; border-radius: 999px; transition: all .12s; }
.rg-chip:hover { color: #0d6efd; background: #f0f6ff; border-color: #0d6efd; }
.rg-chip::before { content: '+ '; color: #9ca3af; }

.rg-drop { padding: 20px; text-align: center; background: #f8fafc; border: 1.5px dashed #cbd5e1; border-radius: 12px; transition: all .15s; }
.rg-drop.drag { background: #eef5ff; border-color: #0d6efd; transform: scale(1.01); }
.rg-drop.filled { padding: 10px; text-align: left; background: #fff; border-style: solid; border-color: #e5e7eb; }
.rg-drop-icon { width: 34px; height: 34px; margin-bottom: 6px; color: #94a3b8; }
.rg-drop-empty { font-size: 13.5px; color: #374151; }
.rg-drop-empty kbd { background: #e5e7eb; color: #374151; font-size: 11px; }
.rg-drop-note { margin-top: 2px; font-size: 12px; color: #9ca3af; }
.rg-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: .08em; }
.rg-or::before, .rg-or::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
.rg-drop-filled { display: flex; align-items: center; gap: 12px; }
.rg-drop-filled img { flex: 0 0 76px; width: 76px; height: 76px; object-fit: contain; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; }
.rg-ref-info { flex: 1; min-width: 0; }
.rg-ref-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-ref-meta { font-size: 12.5px; color: #6b7280; }
.rg-error { margin-top: 8px; padding: 8px 12px; font-size: 13px; color: #b42318; background: #fef3f2; border: 1px solid #fecdca; border-radius: 8px; }

.rg-footer { display: flex; align-items: center; gap: 8px; padding: 14px 22px; background: #f8fafc; border-top: 1px solid #eef0f3; }
.rg-hint { margin-right: auto; font-size: 12px; color: #9ca3af; }
.rg-hint kbd { background: #e5e7eb; color: #374151; font-size: 11px; }

/* ---------- Toasts ---------- */
.app-toast { min-width: 330px; color: #fff; border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 23, 42, .25); }
.app-toast .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.app-toast a { color: #fff; font-weight: 600; }
.app-toast[data-type="info"] { background: #1e293b; }
.app-toast[data-type="success"] { background: #15803d; }
.app-toast[data-type="danger"] { background: #b91c1c; }
.app-toast[data-type="warning"] { background: #b45309; }

/* ---------- Pagination ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 16px; background: #fafbfc; border-top: 1px solid #eef0f3; font-size: 13.5px; color: #6b7280; }
.pager-info b { color: #111827; font-weight: 600; }
.pager-size { display: flex; align-items: center; gap: 8px; margin: 0; }
.pager-size .form-select { width: auto; padding-top: 2px; padding-bottom: 2px; border-radius: 8px; }
.pager-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pg-btn { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
    color: #374151; font-weight: 500; text-decoration: none; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; transition: all .12s; }
.pg-btn:hover { color: #0d6efd; background: #f0f6ff; border-color: #bfd7ff; }
.pg-btn.active { color: #fff; background: #0d6efd; border-color: #0d6efd; box-shadow: 0 2px 6px rgba(13, 110, 253, .3); pointer-events: none; }
.pg-btn.disabled { color: #c0c4cc; background: #fff; border-color: #eef0f3; pointer-events: none; }
.pg-step { padding: 0 12px; }
.pg-gap { min-width: 24px; text-align: center; color: #9ca3af; }
@media (max-width: 640px) { .pager-nav { margin-left: 0; } }

/* ---------- Import page ---------- */
.ix-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.ix-title { margin: 0; font-size: 26px; font-weight: 700; color: #111827; letter-spacing: -.01em; }
.ix-sub { margin: 4px 0 0; color: #6b7280; }

.ix-stat { display: flex; gap: 14px; align-items: flex-start; height: 100%; padding: 16px 18px; text-decoration: none; background: #fff;
    border: 1px solid #eef0f3; border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: all .15s; }
.ix-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 24, 40, .08); border-color: #e2e8f0; }
.ix-stat-icon { flex: 0 0 40px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.ix-stat-icon svg { width: 20px; height: 20px; }
.ix-stat-body { display: flex; flex-direction: column; min-width: 0; }
.ix-stat-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #6b7280; }
.ix-stat-num { font-size: 26px; font-weight: 700; line-height: 1.2; color: #111827; font-variant-numeric: tabular-nums; }
.ix-stat-hint { font-size: 12px; color: #9ca3af; }
.ix-stat-completed .ix-stat-icon { color: #15803d; background: #dcfce7; }
.ix-stat-processing .ix-stat-icon { color: #0369a1; background: #e0f2fe; }
.ix-stat-pending .ix-stat-icon { color: #475569; background: #f1f5f9; }
.ix-stat-failed .ix-stat-icon { color: #b91c1c; background: #fee2e2; }
.ix-live { width: 8px; height: 8px; border-radius: 50%; background: #0ea5e9; animation: ix-pulse 1.4s infinite; }
@keyframes ix-pulse { 0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, .6); } 100% { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0); } }

.ix-card { padding: 22px; background: #fff; border: 1px solid #eef0f3; border-radius: 16px; box-shadow: 0 1px 3px rgba(16, 24, 40, .05); }
.ix-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ix-card-title { margin: 0; font-size: 17px; font-weight: 600; color: #111827; }
.ix-card-sub { margin-top: 2px; font-size: 13px; color: #6b7280; }
.ix-link { font-size: 13px; text-decoration: none; }

.ix-textarea { display: block; width: 100%; min-height: 240px; padding: 14px 16px; resize: vertical; font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
    color: #1f2937; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 12px; outline: 0; transition: all .15s; }
.ix-textarea:focus { background: #fff; border-color: #86b7fe; box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .12); }

.ix-counter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ix-chip { padding: 3px 10px; font-size: 12.5px; border-radius: 999px; }
.ix-chip-ok { color: #15803d; background: #dcfce7; }
.ix-chip-dup { color: #92400e; background: #fef3c7; }
.ix-chip-bad { color: #b91c1c; background: #fee2e2; }

.ix-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #f1f3f5; }
.ix-switch, .ix-switch.form-switch { padding-left: 0; }
.ix-switch { display: flex; gap: 12px; align-items: flex-start; margin: 0; cursor: pointer; }
.ix-switch .form-check-input { width: 2.4em; height: 1.3em; margin: 2px 0 0; flex: 0 0 auto; cursor: pointer; }
.ix-switch b { display: block; font-size: 14px; font-weight: 600; color: #111827; }
.ix-switch small { color: #6b7280; }
.ix-submit { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; font-weight: 600; border-radius: 10px; box-shadow: 0 4px 12px rgba(13, 110, 253, .25); }
.ix-submit svg { width: 18px; height: 18px; }
.ix-submit:disabled { box-shadow: none; }

.ix-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.ix-steps li { position: relative; padding: 0 0 16px 42px; counter-increment: step; }
.ix-steps li:last-child { padding-bottom: 0; }
.ix-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #0d6efd; background: #e8f1ff; border-radius: 50%; }
.ix-steps li:not(:last-child)::after { content: ''; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: #e5e7eb; }
.ix-steps b { display: block; font-size: 14px; color: #111827; }
.ix-steps span { font-size: 13px; color: #6b7280; }

.ix-recent { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ix-recent a { display: block; aspect-ratio: 1; overflow: hidden; background: #fff; border: 1px solid #eef0f3; border-radius: 10px; transition: transform .15s; }
.ix-recent a:hover { transform: scale(1.04); }
.ix-recent img { width: 100%; height: 100%; object-fit: contain; }
