/* ===== Catalog masters: inline image thumbnails ===== */

.djh-data-table th.djh-thumb-col,
.djh-data-table td.djh-thumb-col { width: 76px; padding-right: 0; }

.djh-thumb {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 64px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.djh-thumb:hover { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.djh-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.djh-thumb input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.djh-thumb input[type="file"]:disabled { cursor: progress; }

.djh-thumb--empty { border-style: dashed; border-color: #94a3b8; color: #64748b; background: #f8fafc; }
.djh-thumb--empty svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.djh-thumb--empty small { font-size: 10px; font-weight: 700; letter-spacing: 0.03em; }
.djh-thumb--empty:hover { color: #2563eb; background: #eff6ff; }

.djh-thumb__count {
    position: absolute;
    left: 3px;
    bottom: 3px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
}
.djh-thumb__add {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.55);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.15s;
}
.djh-thumb:hover .djh-thumb__add { opacity: 1; }

.djh-thumb--busy { pointer-events: none; }
.djh-thumb__spinner {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
}
.djh-thumb__spinner::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: djh-thumb-spin 0.7s linear infinite;
}
@keyframes djh-thumb-spin { to { transform: rotate(360deg); } }
