/* ============================================================
   admin-custom.css — admin.css 위에 얹는 파일 관리 전용 컴포넌트
   규칙: 선언은 한 항목당 한 줄. 인라인 style="" 금지.
   ============================================================ */

/* ── 로그인 오류 배너 ─────────────────────────────────────── */
.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px;
  line-height: 1.5;
}
.login-alert i {
  margin-top: 2px;
}

/* ── 업로드 드롭존 ────────────────────────────────────────── */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 38px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.dropzone:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.dropzone.drag {
  border-color: var(--ink);
  background: var(--accent-soft);
  color: var(--ink);
}
.dropzone .dz-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 18px;
}
.dropzone .dz-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.dropzone .dz-sub {
  font-size: 12.5px;
  line-height: 1.6;
}
.dropzone input[type="file"] {
  display: none;
}

/* ── 업로드 진행 목록 ─────────────────────────────────────── */
.upload-queue {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.upload-queue:empty {
  margin-top: 0;
}
.uq-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
}
.uq-item .uq-ic {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 12px;
}
.uq-item.done .uq-ic {
  background: var(--success-soft);
  color: var(--success);
}
.uq-item.fail .uq-ic {
  background: var(--danger-soft);
  color: var(--danger);
}
.uq-item .uq-body {
  min-width: 0;
}
.uq-item .uq-name {
  display: block;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uq-item .uq-msg {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.uq-item.fail .uq-msg {
  color: var(--danger);
}
.uq-item .uq-bar {
  width: 92px;
  height: 5px;
  border-radius: 999px;
  background: var(--grid);
  overflow: hidden;
}
.uq-item .uq-bar > i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width .15s linear;
}

/* ── 파일 테이블 (table.adm 위에 얹는 셀 스타일) ──────────── */
.file-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.file-thumb {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
}
.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-meta {
  min-width: 0;
}
.file-meta .fname {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta .furl {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta .furl:hover {
  color: var(--ink);
  text-decoration: underline;
}
.file-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.file-actions .btn-ghost {
  padding: 5px 10px;
  font-size: 12.5px;
}
.col-num {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  table.adm .col-hide-sm {
    display: none;
  }
}

/* ── 커밋 로그 · 코드 블록 ────────────────────────────────── */
.code-block {
  margin: 0;
  padding: 12px 14px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── 토스트 ───────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  display: grid;
  gap: 8px;
  max-width: min(400px, calc(100vw - 36px));
}
.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  word-break: break-all;
}
.toast-item.in {
  opacity: 1;
  transform: translateY(0);
}
.toast-item i {
  margin-top: 2px;
}
.toast-ok i {
  color: var(--success);
}
.toast-error i {
  color: var(--danger);
}
.toast-info i {
  color: var(--muted);
}

/* ── 대시보드 보조 ────────────────────────────────────────── */
.stat-list {
  display: grid;
  gap: 2px;
}
.stat-list .row-i {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.stat-list .row-i:last-child {
  border-bottom: 0;
}
.stat-list .k {
  color: var(--muted);
}
.stat-list .v {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}
.hint-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
