/* =====================================================================
   FILEDROP — 첨부파일 공통 UI (끌어다 놓기 + 썸네일)

   js/util/FILEDROP.js 가 <input type="file" class="fdz-on"> 을 감싸 만든 틀의 모양.
   화면마다 제각각이던 첨부 입력칸을 전부 이 한 모양으로 통일한다.

   bit.css · 각 화면 css 보다 뒤에 실려(헤더에서) 덮어쓴다.
   ===================================================================== */

.fdz { display:block; }

/* 원래 <input> 은 숨기되 DOM 에는 남긴다 — 저장하는 쪽이 input.files 를 그대로 읽는다 */
.fdz__input { display:none !important; }

/* ── 끌어다 놓는 네모 ── */
.fdz__zone {
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
    padding:18px 14px; text-align:center; cursor:pointer;
    border:1.5px dashed #c5d0e0; border-radius:10px; background:#f8fafc; color:#5b6b82;
    transition:border-color .15s, background .15s, box-shadow .15s;
}
.fdz__zone:hover { border-color:#0a529d; background:#f1f6fc; }
.fdz__zone:focus { outline:none; border-color:#0a529d; box-shadow:0 0 0 3px rgba(10,82,157,.12); }
/* 파일을 끌고 들어왔을 때 — 테두리를 실선으로 바꿔 '여기 놓으면 된다' 를 또렷이 */
.fdz__zone.is-over { border-style:solid; border-color:#0a529d; background:#eaf2fb; color:#0a529d; }

.fdz__ico {
    width:28px; height:28px;
    background:center/contain no-repeat
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8aa0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V7'/%3E%3Cpath d='m8 11 4-4 4 4'/%3E%3Cpath d='M20 16.5A3.5 3.5 0 0 0 18 10h-1.26A6 6 0 1 0 6 15'/%3E%3C/svg%3E");
}
.fdz__main { font-size:13px; line-height:1.4; }
.fdz__main b { color:#0a529d; font-weight:700; }

/* ── 고른 파일 썸네일 ── */
.fdz__grid { display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px; margin-top:10px; }
.fdz__grid:empty { display:none; margin-top:0; }

.fdz__thumb {
    position:relative; width:84px; height:84px; border-radius:8px; overflow:hidden;
    border:1px solid #e3e8f0; background:#fff;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
}
/* 그림 : 꽉 채운 썸네일 + 아래에 흐린 이름 띠 */
.fdz__thumb.is-img { background-size:cover; background-position:center; }
.fdz__thumb.is-img .fdz__name {
    position:absolute; left:0; right:0; bottom:0; padding:3px 6px;
    background:linear-gradient(to top, rgba(17,22,31,.72), rgba(17,22,31,0));
    color:#fff; font-size:10px;
}
.fdz__name {
    max-width:100%; padding:0 4px; font-size:10.5px; line-height:1.3;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* 이미 올라간 그림 썸네일 : 칸 전체를 덮는 보기 링크.
   이름 띠는 클릭을 가로채지 않게 두고(pointer-events:none), × 는 링크보다 위에 둔다 */
.fdz__open { position:absolute; top:0; right:0; bottom:0; left:0; z-index:1; }
.fdz__thumb.is-stored .fdz__name { pointer-events:none; position:absolute; z-index:0; }
.fdz__thumb.is-stored:hover { border-color:#0a529d; }

/* ── 그림이 아닌 파일 : 네모 썸네일 대신 '파일명 칩' ── */
.fdz__file {
    display:inline-flex; align-items:center; gap:7px; max-width:100%;
    padding:7px 9px 7px 11px; border:1px solid #e3e8f0; border-radius:8px; background:#f7f9fc;
}
.fdz__fico {
    flex:0 0 auto; width:16px; height:16px;
    background:center/contain no-repeat
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8aa0' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E");
}
.fdz__fname {
    flex:1 1 auto; min-width:0; max-width:260px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    font-size:12.5px; color:#41506a; text-decoration:none;
}
a.fdz__fname:hover { color:#0a529d; text-decoration:underline; }

/* 한 장 빼기 (× ) — 그림 썸네일은 모서리에 띄운 동그라미 */
.fdz__x {
    z-index:2;
    position:absolute; top:3px; right:3px; width:18px; height:18px; padding:0;
    display:flex; align-items:center; justify-content:center;
    border:0; border-radius:50%; cursor:pointer;
    background:rgba(17,22,31,.68); color:#fff; font-size:13px; line-height:1;
}
.fdz__x:hover { background:#c9313d; color:#fff; }
/* 파일명 칩 안의 × 는 모서리에 띄우지 않고 이름 옆에 인라인으로 */
.fdz__x--chip {
    position:static; margin-left:2px; flex:0 0 auto;
    background:transparent; color:#aab2c0; font-size:15px;
}
.fdz__x--chip:hover { background:transparent; color:#c9313d; }

/* 좁은 화면에서는 썸네일을 조금 줄인다 */
@media (max-width: 520px) {
    .fdz__thumb { width:72px; height:72px; }
    .fdz__zone { padding:14px 10px; }
}

/* ── 화면별 자리 맞춤 ──────────────────────────────────────
   드래그존은 블록이라, 원래 입력칸이 들어 있던 가로 배치(flex)에서 자리를 다시 잡아 준다 */

/* 내 할일 : 드래그존이 첨부 추가 칸의 폭을 가득 채운다 */
.td-files__add .fdz { flex:1 1 auto; min-width:0; }

/* 이미 올라간 첨부를 썸네일 격자로 보여 줄 때 (OPS_CRUD type:'files' 의 수정 모달) —
   맨 위에 오므로 윗여백은 없애고, 드래그존과 떨어뜨린다 */
.cfg-files__had.fdz__grid { margin-top:0; margin-bottom:10px; }

/* 올리는 중 가림막은 공용 로딩창(.loading-container, bit.css)을 그대로 쓴다 — 여기선 따로 두지 않는다 */
